コード例 #1
0
        private void updatecode()
        {
            try
            {
                if (hd.Value == "false" && hde.Value == "false")
                {
                    context.sp_UpdateUser(Convert.ToInt32(ViewState["bachid"])
                                          , Convert.ToInt32(ViewState["user"].ToString())
                                          , txtUserEmail.Text
                                          , txtUserEmail.Text
                                          , txtContactNo.Text
                                          , Convert.ToInt32(ddlRole.SelectedValue)
                                          , Convert.ToInt32(ddlBranch.SelectedValue)
                                          , companyId
                                          , true
                                          , User_id
                                          , DateTime.Now
                                          , txtFirstName.Text
                                          , txtLastname.Text
                                          );

                    //context.tbl_User.


                    btnUpdate.Visible = false;
                    btnSave.Visible   = true;
                    gridbind();
                    txtPassword.Enabled = true;
                    clr();
                    divalert.Visible                = true;
                    lblAlert.Text                   = "User Updated Successfully ";
                    rfcontact.Enabled               = true;
                    txtContactNo.Enabled            = true;
                    rgx.Enabled                     = true;
                    RequiredFieldValidator3.Enabled = true;
                    txtUserEmail.Enabled            = true;
                }
                else
                {
                    divalert.Visible = true;
                    lblAlert.Text    = "Email Or Contact No Is Already Exists ";
                }
            }
            catch (Exception ex)
            {
                ErrorLog.saveerror(ex);
            }
        }
コード例 #2
0
        private void updatecode()
        {
            try
            {
                if (hd.Value == "false" && hde.Value == "false")
                {
                    //UserRol r = new UserRol();
                    // GridViewRow row = GridView1.SelectedRow;
                    //r.userbranch_id = Convert.ToInt32(ViewState["bachid"]);
                    //r.role_id = Convert.ToInt32(ddlRole.SelectedValue);
                    //r.branch_id = Convert.ToInt32(ddlBranch.SelectedValue);
                    //r.user_name = txtUserEmail.Text;
                    //r.first_name = txtFirstName.Text;
                    //r.last_name = txtLastname.Text;
                    //r.user_Emai = txtUserEmail.Text;
                    //r.user_mobieno = txtContactNo.Text;
                    //r.company_id = companyId;
                    //r.userbranch_id = Convert.ToInt32(ViewState["Userbranch"]);
                    //r.user_id = Convert.ToInt32(ViewState["user"].ToString());
                    //r.status = true;
                    //r.modified_by = User_id;
                    //r.modified_date = DateTime.Now;
                    ////Shakeeb
                    ////r.Update(r);

                    context.sp_UpdateUser(Convert.ToInt32(ViewState["bachid"])
                                          , Convert.ToInt32(ViewState["user"].ToString())
                                          , txtUserEmail.Text
                                          , txtUserEmail.Text
                                          , txtContactNo.Text
                                          , Convert.ToInt32(ddlRole.SelectedValue)
                                          , Convert.ToInt32(ddlBranch.SelectedValue)
                                          , companyId
                                          , true
                                          , User_id
                                          , DateTime.Now
                                          , txtFirstName.Text
                                          , txtLastname.Text
                                          );

                    //context.tbl_User.


                    btnUpdate.Visible = false;
                    btnSave.Visible   = true;
                    gridbind();
                    txtPassword.Enabled = true;
                    clr();
                    divalert.Visible                = true;
                    lblAlert.Text                   = "User Updated Successfully ";
                    rfcontact.Enabled               = true;
                    txtContactNo.Enabled            = true;
                    rgx.Enabled                     = true;
                    RequiredFieldValidator3.Enabled = true;
                    txtUserEmail.Enabled            = true;
                }
                else
                {
                    divalert.Visible = true;
                    lblAlert.Text    = "Email Or Contact No Is Already Exists ";
                }
            }
            catch (Exception ex)
            {
                ErrorLog.saveerror(ex);
            }
        }