Пример #1
0
    protected void viewCTLT_SYSTEM_ListView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        try
        {
            dsCTLT_SYSTEM_ListView.DeleteParameters.Clear();
            dsCTLT_SYSTEM_ListView.DeleteParameters.Add("SYS_CODE", e.Values["SYS_CODE"] + "");
            CountData();

            CMNWebReference.CMNWebService CMN_WebService = new CMNWebReference.CMNWebService();
            CMN_WebService.Timeout = 10000;
            //CMN_WebService.Url = OPM_BL.GetSysconfig("config_name");
            string Syscode = (e.Values["SYS_CODE"] != null)?e.Values["SYS_CODE"].ToString():"";
            if(Syscode != "")
            {
                string ret = CMN_WebService.DeleteCTLT_SYSTEM(Syscode);
                LogFileEng.SaveActionTransLog("CMN_UT0301", "Delete", "Success : SYS_CODE : " + Syscode, "CTLT_SYSTEM", "SYS_CODE", "", Request);
                if (ret == "true")
                {
                    LogFileEng.SaveActionTransLog("CMN_UT0301", "Delete : Service", "Success : SYS_CODE : " + Syscode, "CTLT_SYSTEM", "SYS_CODE", "", Request);
                }
                else
                {
                    LogFileEng.SaveActionTransLog("CMN_UT0301", "Delete : Service", "Error : SYS_CODE : " + Syscode, "CTLT_SYSTEM", "SYS_CODE", "", Request);
                }
            }
        }
        catch (Exception ex)
        {

        }
    }
    protected void viewCTLT_ITEM_ListView_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        string ITEM_CODE = string.Empty;
        try
        {
            string UserID = LoginUserData.getLoginUserCode(Request);
            dsCTLT_ITEM_ListView.UpdateParameters.Clear();
            dsCTLT_ITEM_ListView.UpdateParameters.Add("ITEM_CODE", e.NewValues["ITEM_CODE"] + "");
            dsCTLT_ITEM_ListView.UpdateParameters.Add("ITEM_TYPE", e.NewValues["ITEM_TYPE"] + "");
            dsCTLT_ITEM_ListView.UpdateParameters.Add("ITEM_NAME", e.NewValues["ITEM_NAME"] + "");
            dsCTLT_ITEM_ListView.UpdateParameters.Add("USER_ID", OPM_BL._Username + "");
            dsCTLT_ITEM_ListView.UpdateParameters.Add("LAST_DATE", System.Data.DbType.DateTime, DateTime.Now.ToString());
            dsCTLT_ITEM_ListView.UpdateParameters.Add("URL", e.NewValues["URL"] + "");

            ITEM_CODE = (e.NewValues["ITEM_CODE"] != null) ? e.NewValues["ITEM_CODE"].ToString() : "";
            string ITEM_TYPE = (e.NewValues["ITEM_TYPE"] != null) ? e.NewValues["ITEM_TYPE"].ToString() : "";
            string ITEM_NAME = (e.NewValues["ITEM_NAME"] != null) ? e.NewValues["ITEM_NAME"].ToString() : "";
            string URL = (e.NewValues["URL"] != null) ? e.NewValues["URL"].ToString() : "";

            CMNWebReference.CMNWebService CMN_WebService = new CMNWebReference.CMNWebService();
            CMN_WebService.Timeout = 10000;
            //CMN_WebService.Url = OPM_BL.GetSysconfig("config_name");
            LogFileEng.SaveActionTransLog("CMN_UT0302", "UPDATE", "Success : ITEM_CODE" + ITEM_CODE + "SYS_CODE : " + ctlSYS_CODE.Text, "CTLT_ITEM", ITEM_CODE, "", Request);
            string ret = CMN_WebService.SaveCTLT_ITEM(ITEM_CODE, ctlSYS_CODE.Text, ITEM_TYPE, ITEM_NAME, ITEM_CODE, UserID,URL, "");
            if (ret == "true")
            {
                LogFileEng.SaveActionTransLog("CMN_UT0302", "UPDATE : WebService", "Success : ITEM_CODE" + ITEM_CODE + "SYS_CODE : " + ctlSYS_CODE.Text, "CTLT_ITEM", ITEM_CODE, "", Request);
            }
            else
            {
                LogFileEng.SaveActionTransLog("CMN_UT0302", "Error : WebService", "Success : ITEM_CODE" + ITEM_CODE + "SYS_CODE : " + ctlSYS_CODE.Text, "CTLT_ITEM", ITEM_CODE, "", Request);
            }
        }
        catch (Exception ex)
        {
            LogFileEng.SaveActionTransLog("CMN_UT0302", "UPDATE", "Error : ITEM_CODE" + ITEM_CODE + "SYS_CODE : " + ctlSYS_CODE.Text, "CTLT_ITEM", ITEM_CODE, "", Request);
        }
    }
    void Update()
    {
        //
        string UserID = LoginUserData.getLoginUserCode(Request);

        dsCTLT_SYSTEM_DetailView.UpdateParameters.Clear();
        dsCTLT_SYSTEM_DetailView.UpdateParameters.Add("SYS_CODE", System.Data.DbType.String, ctlSYS_CODE.Text);
        dsCTLT_SYSTEM_DetailView.UpdateParameters.Add("SYS_NAME", System.Data.DbType.String, ctlSYS_NAME.Text);
        dsCTLT_SYSTEM_DetailView.UpdateParameters.Add("SYS_ABBR_NAME", System.Data.DbType.String, ctlSYS_ABBR_NAME.Text);
        dsCTLT_SYSTEM_DetailView.UpdateParameters.Add("SYS_TH_NAME", System.Data.DbType.String, ctlSYS_TH_NAME.Text);
        dsCTLT_SYSTEM_DetailView.UpdateParameters.Add("SYS_TH_ABBR_NAME", System.Data.DbType.String, ctlSYS_TH_ABBR_NAME.Text);
        dsCTLT_SYSTEM_DetailView.UpdateParameters.Add("BASIC_TYPE", System.Data.DbType.String, _chkDefault());
        dsCTLT_SYSTEM_DetailView.UpdateParameters.Add("SYS_TYPE", System.Data.DbType.String, ctlPROGRAM_TYPE.Value.ToString());
        //dsCTLT_SYSTEM_DetailView.UpdateParameters.Add("SYS_CODE", System.Data.DbType.String, inputMainSYS_CODE);
        dsCTLT_SYSTEM_DetailView.UpdateParameters.Add("PATTERN_CODE", System.Data.DbType.String, ctlPATTERN_CODE.Value.ToString());

        int i = dsCTLT_SYSTEM_DetailView.Update();
        if (i > 0)
        {
          CMNWebReference.CMNWebService CMN_WebService = new CMNWebReference.CMNWebService();
          CMN_WebService.Timeout = 10000;
          //CMN_WebService.Url = OPM_BL.GetSysconfig("config_name");
          LogFileEng.SaveActionTransLog("CMN_UT0302", "UPDATE", "Success : SYS_CODE" + ctlSYS_CODE.Text, "CTLT_SYSTEM", ctlSYS_CODE.Text, "", Request);
          string ret = CMN_WebService.SaveCTLT_SYSTEM(ctlSYS_CODE.Text, ctlSYS_NAME.Text, ctlSYS_ABBR_NAME.Text, ctlSYS_TH_NAME.Text, ctlSYS_TH_ABBR_NAME.Text, _chkDefault(), ctlPROGRAM_TYPE.Value.ToString(), ctlPATTERN_CODE.Value.ToString(), UserID);
          if (ret == "true")
          {
              LogFileEng.SaveActionTransLog("CMN_UT0302", "UPDATE : WebService", "Success : SYS_CODE" + ctlSYS_CODE.Text, "CTLT_SYSTEM", "SYS_CODE", "", Request);
          }
          else
          {
              LogFileEng.SaveActionTransLog("CMN_UT0302", "UPDATE : WebService", "Error : SYS_CODE" + ctlSYS_CODE.Text, "CTLT_SYSTEM", "SYS_CODE", "", Request);
          }
        }
        else
        {
            LogFileEng.SaveActionTransLog("CMN_UT0302", "UPDATE", "Error : SYS_CODE" + ctlSYS_CODE.Text, "CTLT_SYSTEM", "SYS_CODE", "", Request);

        }

        JS = "alert('Updated');";
    }
    protected void viewCTLT_ITEM_ListView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        string ITEM_CODE = (e.Values["ITEM_CODE"] != null) ? e.Values["ITEM_CODE"].ToString() : "";

        try
        {
            CMNWebReference.CMNWebService CMN_WebService = new CMNWebReference.CMNWebService();
            CMN_WebService.Timeout = 10000;
            //CMN_WebService.Url = OPM_BL.GetSysconfig("config_name");
            string ret = CMN_WebService.DeleteCTLT_ITEM(ITEM_CODE, ctlSYS_CODE.Text);
            LogFileEng.SaveActionTransLog("CMN_UT0302", "Delete", "Success : ITEM_CODE" + ITEM_CODE + "SYS_CODE : " + ctlSYS_CODE.Text, "CTLT_ITEM", "ITEM_CODE", "", Request);
            if (ret == "true")
            {
                LogFileEng.SaveActionTransLog("CMN_UT0302", "Delete : Service", "Success : ITEM_CODE" + ITEM_CODE + "SYS_CODE : " + ctlSYS_CODE.Text, "CTLT_ITEM", "ITEM_CODE", "", Request);
            }
            else
            {
                LogFileEng.SaveActionTransLog("CMN_UT0302", "Delete : Service", "Error : ITEM_CODE" + ITEM_CODE + "SYS_CODE : " + ctlSYS_CODE.Text, "CTLT_ITEM", "ITEM_CODE", "", Request);
            }
        }
        catch (Exception ex)
        {
            LogFileEng.SaveActionTransLog("CMN_UT0302", "Delete", "Error : ITEM_CODE" + ITEM_CODE + "SYS_CODE : " + ctlSYS_CODE.Text, "CTLT_ITEM", "ITEM_CODE", "", Request);
        }
    }