[精讚] [會員登入]

[自用] 臨時工作筆記

[自用] 臨時工作筆記

分享完整連結 //n.sfs.tw/m10829

分享連結 [自用] 臨時工作筆記@精讚
(文章歡迎轉載,請尊重版權註明連結來源)
2022-03-08 20:51:10 By 大塚 宏

[工作用的臨時筆記,僅供私人用途,無參考價值XD]

多一個欄位,繫結ibpm_dlt

https://www.taaze.tw/products/11313057209.html#

https://www.taaze.tw/products/11312776831.html

https://www.taaze.tw/usedList.html?oid=11100033190

日文解釋所引起之台灣譯者的翻譯問題點―以長句子的處理為中心―

 

 

電子表單(前端)

$(document).ready(function(){

    var params = {

       itype: 'funcion_name'

    };

 

YZSoft.Ajax.RFC({

            url: 'function.ashx',

            sync: true,

            params: params,

            success: function (action) {

                var res = Ext.decode(action.responseText);

                var stepData = Ext.decode(res.stepData);

                var seletor = $('#XDropDownList1')[0];

 

                var i = 0;

               

                stepData.forEach(function (item) {                   

                    if (i == 0) {

                        seletor.remove(0); //移除預設(未繫結)

                        seletor.add(new Option('-請選擇-', ''));

                    }

 

                    i++;

                    seletor.add(new Option(item.DisplayName,item.Code));

                });

 

                seletor.selectedIndex = 0;

            },

            failure: function (action) {

                var res = Ext.decode(action.responseText);

                alert(res.msg);

            }

        });

});

 

後端

public void ProcessRequest(HttpContext context)

    {

        JsonItem rv = new JsonItem();

        Global.errMsg = "";

       

        //取得傳入參數

        bool typeError = false;

 

        string itype = "";

 

        try

        {

            itype = context.Request.QueryString["itype"];

        }

        catch (Exception ex)

        {

            Global.errMsg = "傳入參數處理錯誤-" + ex.Message;

            typeError = true;

        }

        if (typeError == false)

        {

            result ST = new result();

            DataTable dt = new DataTable();

            switch (itype)

            {

                case "function_name":

                    List<DDLItem> stepList = get_ddl_account();

                    rv.Attributes.Add("stepData", new JavaScriptSerializer().Serialize(stepList));

                    break;

            }

        }

 

        if (Global.errMsg == "")

        {

            rv.Attributes.Add("success", true);

        }

        else

        {

            rv.Attributes.Add("success", false);

        }

        rv.Attributes.Add("msg", Global.errMsg);

        context.Response.Write(rv.ToString());

    }

 

public static List<DDLItem> function_name()

    {

        List<DDLItem> rtList = new List<DDLItem>();

 

        string sql = string.Empty;

        sql += "select * from data";

 

        DataTable dt = SqlServerDbConnection.MakeDate(ExecWhere.ashx, DataMode.Get, sql);

 

        foreach (DataRow row in dt.Rows)

        {

            DDLItem item = new DDLItem()

            {

                DisplayName = string.Format("{0}", row["DisplayName"]),

                Code = string.Format("{0}", row["UserAccount"])

            };

 

            rtList.Add(item);

        }

 

        return rtList;

    }

 

 

/// <summary>節點選項</summary>

public class DDLItem

{

    /// <summary>節點代號</summary>

    public string Code { get; set; }

 

    /// <summary>節點資訊</summary>

    public string DisplayName { get; set; }

}

 

 

 

string datetime = String.Format("{0:yyyy-MM-dd} 17:30:00", "2022-04-08");
            datetime = "2022-04-08";

            DateTime a = Convert.ToDateTime(String.Format("{0:yyyy-MM-dd}", datetime));

            string year = a.Year.ToString();
            if (a.Month <= 3)
            {
                a = Convert.ToDateTime(year + "-03-31");
            }
            else if (a.Month <= 6)
            {
                a = Convert.ToDateTime(year + "-06-30");
            }
            else if (a.Month <= 9)
            {
                a = Convert.ToDateTime(year + "-09-30");
            }
            else if (a.Month <= 12)
            {
                a = Convert.ToDateTime(year + "-12-31");
            }
            datetime = String.Format("{0:yyyy-MM-dd}", a);
            
            Console.WriteLine(a);
            Console.WriteLine(datetime);

END
你可能有興趣

網站分享

C#之WinForm WebBrowser實用技巧匯總 https://www.796t.com/content/151

[自用] 臨時工作筆記

[自用] 臨時工作筆記

我發現這裡可以新增我的發現

我發現這裡可以新增我的發現的內文