예제 #1
0
 private void bindData()
 {
     System.Int32 EditId;
     if (Request.QueryString["id"] == null)
     {
         return;
     }
     else
     {
         EditId = System.Int32.Parse(Request.QueryString["id"].ToString());
         CustomerFields m_CustomerFields = new CustomerFields();
         m_CustomerFields.CustomerFieldId = EditId;
         m_CustomerFields    = m_CustomerFields.Get();
         txCustomerId.Text   = m_CustomerFields.CustomerId.ToString();
         txFieldId.Text      = m_CustomerFields.FieldId.ToString();
         txDocGroupId.Text   = m_CustomerFields.DocGroupId.ToString();
         txDisplayOrder.Text = m_CustomerFields.DisplayOrder.ToString();
         txCrDateTime.Text   = m_CustomerFields.CrDateTime.ToString("dd/MM/yyyy");
     }
 }
예제 #2
0
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        byte SysMessageTypeId = 0;
        int  SysMessageId     = 0;

        System.Int32   EditId;
        CustomerFields m_CustomerFields = new CustomerFields();

        if (Request.QueryString["id"] == null)
        {
            EditId = 0;
        }
        else
        {
            EditId = System.Int32.Parse(Request.QueryString["id"].ToString());
            m_CustomerFields.CustomerFieldId = EditId;
            m_CustomerFields = m_CustomerFields.Get();
        }
        try
        {
            if (txCustomerId.Text == "")
            {
                JSAlertHelpers.Alert("Mời bạn nhập các thông tin bắt buộc!", this);
                return;
            }
            if (txFieldId.Text == "")
            {
                JSAlertHelpers.Alert("Mời bạn nhập các thông tin bắt buộc!", this);
                return;
            }
            if (txDocGroupId.Text == "")
            {
                JSAlertHelpers.Alert("Mời bạn nhập các thông tin bắt buộc!", this);
                return;
            }
            if (txDisplayOrder.Text == "")
            {
                JSAlertHelpers.Alert("Mời bạn nhập các thông tin bắt buộc!", this);
                return;
            }


            m_CustomerFields.CrUserId = ActUserId;

            m_CustomerFields.CustomerId = int.Parse(txCustomerId.Text);

            m_CustomerFields.FieldId = short.Parse(txFieldId.Text);

            m_CustomerFields.DocGroupId = byte.Parse(txDocGroupId.Text);

            m_CustomerFields.DisplayOrder = short.Parse(txDisplayOrder.Text);

            m_CustomerFields.CustomerFieldId = EditId;
            SysMessageTypeId = m_CustomerFields.InsertOrUpdate(ConstantHelpers.Replicated, ActUserId, ref SysMessageId);

            StringBuilder       csText = new StringBuilder();
            Type                cstype = this.GetType();
            ClientScriptManager cs     = Page.ClientScript;
            csText.Clear();
            csText.Append("<script type=\"text/javascript\">");
            csText.Append("window.parent.jQuery('#divEdit').dialog('close');");
            csText.Append("</script>");
            cs = Page.ClientScript;
            cs.RegisterClientScriptBlock(this.GetType(), "system_message", csText.ToString());
        }
        catch (Exception ex)
        {
            sms.utils.LogFiles.LogError(((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name + "\t" + ex.ToString());
            JSAlertHelpers.Alert(ex.Message, this);
        }
    }