Пример #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int roleid = Convert.ToInt32(rblRole.SelectedValue);
            int masterid = Convert.ToInt32(Request.QueryString["MasterId"].ToString());
            MasterInfo master = new MasterInfo(masterid);
            if (rblIsOver.SelectedItem.Text == "ͨ��")
            {
                master.State = 2;
                master.Save();
                try
                {
                    //��ӽ�ɫ
                    if (RoleInfo.isRoleMaster(masterid))
                    {
                        RoleInfo.UpdateRoleMasters(masterid);
                    }
                    else
                    {
                        RoleMasterInfo rm = new RoleMasterInfo();
                        rm.RoleId = roleid;
                        rm.MasterId = masterid;
                        rm.IsPass = 1;
                        rm.Save();
                    }
                    //���Ȩ��
                    if (RoleInfo.isActionMaster(masterid))
                    {
                        RoleInfo.DelActionMaster(masterid);
                        AddActionMaster(masterid);

                    }
                    else
                    {
                        AddActionMaster(masterid);
                    }
                    master.IsApply = 1;
                    master.Save();
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('Ȩ�����óɹ���');</script>");
                }
                catch (Exception Ex)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('����ʧ�ܣ�" + Ex.Message + "');", true);
                }
            }
            else
            {
                master.State = 3;
                master.Save();
            }
        }
Пример #2
0
        protected void btnAddUser_Click(object sender, EventArgs e)
        {
            if (IsPageValid())
            {
                string strName = txtUserName.Text.ToString();
                bool isexit = MasterInfo.IsUserExit(strName);
                if (!isexit)
                {
                    try
                    {
                        MasterInfo master = new MasterInfo();
                        master.MasterName = txtUserName.Text.ToString();
                        master.MasterPsd = txtNewPsd.Text.ToString();
                        master.DepartId = Convert.ToInt32(ddlDepart.SelectedValue.ToString());
                        DateTime time = DateTime.Now;
                        master.CreateDate = time;
                        master.EmployeeId = Convert.ToInt32(ddlEmployee.SelectedValue.ToString());
                        master.State = 0;
                        master.IsApply = 0;
                        master.Save();
                        FileEmployee();
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('��ӳɹ���');</script>");
                    }
                    catch (Exception Ex)
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('����ʧ�ܣ�" + Ex.Message + "');", true);
                    }
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('�û����Ѵ��ڣ���������ӣ�');</script>");
                }

            }
        }
Пример #3
0
 public object  SaveMasterInfo(MasterInfo masterInfo)
 {
     masterInfo.Save();
     return(masterInfo.MasterId);
 }
Пример #4
0
 public object SaveMasterInfo(MasterInfo masterInfo)
 {
     masterInfo.Save();
     return masterInfo . MasterId;
 }
Пример #5
0
        protected void gvMaster_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            int masterid = Convert.ToInt32(gvMaster.DataKeys[e.RowIndex].Value);
            TextBox txtMasterName = gvMaster.Rows[e.RowIndex].FindControl("txtMasterName") as TextBox;
            try
            {

                MasterInfo master = new MasterInfo(masterid);
                master.MasterName = txtMasterName.Text.ToString();
                master.Save();
                gvMaster.EditIndex = -1;
                gvDataBind();
            }
            catch (Exception Ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('����ʧ�ܣ�" + Ex.Message + "');", true);
            }
        }