示例#1
0
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        byte SysMessageTypeId = 0;
        int  SysMessageId     = 0;

        System.Int16 EditId;
        ProductTypes m_ProductTypes = new ProductTypes();

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


            m_ProductTypes.CrUserId = ActUserId;

            if (txProductTypeName.Text != "")
            {
                m_ProductTypes.ProductTypeName = txProductTypeName.Text;
            }

            if (txProductTypeDesc.Text != "")
            {
                m_ProductTypes.ProductTypeDesc = txProductTypeDesc.Text;
            }

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

            m_ProductTypes.ProductTypeId = EditId;
            SysMessageTypeId             = m_ProductTypes.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);
        }
    }
示例#2
0
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        byte SysMessageTypeId = 0;
        int  SysMessageId     = 0;

        System.Byte EditId;
        Sections    m_Sections = new Sections();

        if (Request.QueryString["id"] == null)
        {
            EditId = 0;
        }
        else
        {
            EditId = System.Byte.Parse(Request.QueryString["id"].ToString());
            m_Sections.SectionId = EditId;
            m_Sections           = m_Sections.Get();
        }
        try
        {
            m_Sections.CrUserId = ActUserId;

            if (txSectionName.Text != "")
            {
                m_Sections.SectionName = txSectionName.Text;
            }

            m_Sections.StartTime = byte.Parse(txStartTime.Text);

            m_Sections.EndTime = byte.Parse(txEndTime.Text);

            m_Sections.SectionId = EditId;
            SysMessageTypeId     = m_Sections.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);
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         ActUserId = SessionHelpers.GetUserId();
         if (!IsPostBack)
         {
             if (Request.QueryString["id"] == null)
             {
             }
             else
             {
                 bindData();
             }
         }
     }
     catch (Exception ex)
     {
         sms.utils.LogFiles.LogError(((new System.Diagnostics.StackTrace()).GetFrames()[0]).GetMethod().Name + "\t" + ex.ToString());
         JSAlertHelpers.Alert(ex.Message, this);
     }
 }
示例#4
0
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        byte SysMessageTypeId = 0;
        int  SysMessageId     = 0;

        System.Int32 EditId;
        OnePayTrans  m_OnePayTrans = new OnePayTrans();

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


            m_OnePayTrans.CrUserId = ActUserId;

            if (txvpc_OrderInfo.Text != "")
            {
                m_OnePayTrans.vpc_OrderInfo = txvpc_OrderInfo.Text;
            }

            m_OnePayTrans.vpc_Amount = int.Parse(txvpc_Amount.Text);

            if (txvpc_TicketNo.Text != "")
            {
                m_OnePayTrans.vpc_TicketNo = txvpc_TicketNo.Text;
            }

            if (txAgainLink.Text != "")
            {
                m_OnePayTrans.AgainLink = txAgainLink.Text;
            }

            m_OnePayTrans.vpc_TxnResponseCode = int.Parse(txvpc_TxnResponseCode.Text);

            if (txvpc_TransactionNo.Text != "")
            {
                m_OnePayTrans.vpc_TransactionNo = txvpc_TransactionNo.Text;
            }

            if (txvcp_Message.Text != "")
            {
                m_OnePayTrans.vcp_Message = txvcp_Message.Text;
            }

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

            if (txResponseTime.Text != "")
            {
                m_OnePayTrans.ResponseTime = DateTime.Parse(txResponseTime.Text);
            }


            m_OnePayTrans.TransId = EditId;
            SysMessageTypeId      = m_OnePayTrans.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);
        }
    }
示例#5
0
    protected void btnSave_Click(object sender, System.EventArgs e)
    {
        byte SysMessageTypeId = 0;
        int  SysMessageId     = 0;

        System.Int32 EditId;
        Customers    m_Customers = new Customers();

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


            m_Customers.CrUserId = ActUserId;

            if (txFullName.Text != "")
            {
                m_Customers.FullName = txFullName.Text;
            }

            if (txMobile.Text != "")
            {
                m_Customers.Mobile = txMobile.Text;
            }

            if (txEmail.Text != "")
            {
                m_Customers.Email = txEmail.Text;
            }

            if (txAddress.Text != "")
            {
                m_Customers.Address = txAddress.Text;
            }

            m_Customers.GenderId = byte.Parse(txGenderId.Text);

            m_Customers.CustomerGroupId = short.Parse(txCustomerGroupId.Text);

            if (txNote.Text != "")
            {
                m_Customers.Note = txNote.Text;
            }

            m_Customers.StatusId = byte.Parse(txStatusId.Text);

            if (txDebitBalance.Text != "")
            {
                m_Customers.DebitBalance = txDebitBalance.Text;
            }

            if (txPaymentLimit.Text != "")
            {
                m_Customers.PaymentLimit = txPaymentLimit.Text;
            }

            if (txDateOfBirth.Text != "")
            {
                m_Customers.DateOfBirth = DateTime.Parse(txDateOfBirth.Text);
            }


            if (txLastTradingDay.Text != "")
            {
                m_Customers.LastTradingDay = DateTime.Parse(txLastTradingDay.Text);
            }


            m_Customers.CustomerId = EditId;
            SysMessageTypeId       = m_Customers.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);
        }
    }