コード例 #1
0
        //行点击事件
        protected void Grid_Files_RowCommand(object sender, GridCommandEventArgs e)
        {
            BLHelper.BLLUser user = new BLHelper.BLLUser();
            try
            {
                string Person   = Grid_Equipment.Rows[e.RowIndex].Values[2].ToString();
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;

                if (Person != username && Convert.ToInt32(Session["SecrecyLevel"]) != 5)
                {
                    string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!";
                    CBoxSelect.SetCheckedState(e.RowIndex, false);
                    Alert.ShowInTop(str);
                }
                if (pm.GridCount(Grid_Equipment, CBoxSelect).Count == 0)
                {
                    btnDelete.Enabled = false;
                    return;
                }
                if (pm.GridCount(Grid_Equipment, CBoxSelect).Count != 0)
                {
                    btnDelete.Enabled = true;
                    return;
                }
            }
            catch (Exception ex)
            {
                pm.SaveError(ex, this.Request);
            }
        }
コード例 #2
0
        //删除选择行的点击事件
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            BLHelper.BLLOperationLog op      = new BLHelper.BLLOperationLog();
            OperationLog             operate = new OperationLog();

            BLHelper.BLLUser user = new BLHelper.BLLUser();
            try
            {
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    for (int i = 0; i < pm.GridCount(Grid_Equipment, CBoxSelect).Count(); i++)
                    {
                        bllequipment.Delete(Convert.ToInt32(Grid_Equipment.DataKeys[pm.GridCount(Grid_Equipment, CBoxSelect)[i]][0].ToString()));
                    }
                    InitData();
                    btnSelect_All.Text = "全选";
                    Alert.ShowInTop("删除数据成功!");
                }
                else
                {
                    for (int i = 0; i < pm.GridCount(Grid_Equipment, CBoxSelect).Count(); i++)
                    {
                        bllequipment.UpdateIsPass(Convert.ToInt32(Grid_Equipment.DataKeys[pm.GridCount(Grid_Equipment, CBoxSelect)[i]][0]), false);
                        operate.LoginName        = username;
                        operate.OperationTime    = DateTime.Now;
                        operate.LoginIP          = " ";
                        operate.OperationContent = "Equipments";
                        operate.OperationType    = "删除";
                        operate.OperationDataID  = Convert.ToInt32(Grid_Equipment.DataKeys[pm.GridCount(Grid_Equipment, CBoxSelect)[i]][0]);
                        op.Insert(operate);
                    }
                    InitData();
                    btnSelect_All.Text = "全选";
                    Alert.ShowInTop("您的数据已提交,请等待确认!");
                }
            }
            catch (Exception ex)
            {
                pm.SaveError(ex, this.Request);
            }
        }
コード例 #3
0
        //行点击事件
        protected void Grid_FurtherStudy_RowCommand(object sender, GridCommandEventArgs e)
        {
            string Person = Grid_FurtherStudy.Rows[e.RowIndex].Values[0].ToString();

            BLHelper.BLLUser user     = new BLHelper.BLLUser();
            string           username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;

            if (Person != username && Convert.ToInt32(Session["SecrecyLevel"]) != 5)
            {
                string str = "您无对此行操作的权限!此行信息为" + Person + "录入,请与管理员联系!";
                CBoxSelect.SetCheckedState(e.RowIndex, false);
                Alert.ShowInTop(str);
            }
            if (pm.GridCount(Grid_FurtherStudy, CBoxSelect).Count == 0)
            {
                btnDelete.Enabled = false;
            }
            else
            {
                btnDelete.Enabled = true;
            }
        }
コード例 #4
0
        //行点击
        protected void gd_UnitAPeople_RowCommand(object sender, GridCommandEventArgs e)
        {
            string person = gd_UnitAPeople.Rows[e.RowIndex].Values[0].ToString();

            BLHelper.BLLUser user     = new BLHelper.BLLUser();
            string           username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;

            if (Convert.ToInt32(Session["SecrecyLevel"]) != 5 && person != username)
            {
                string str = "您没有对此行操作的权限!此行为" + person + "录入,请与管理员联系!";
                Alert.ShowInTop(str);
                CBoxSelect.SetCheckedState(e.RowIndex, false);
            }
            if (pm.GridCount(gd_UnitAPeople, CBoxSelect).Count == 0)
            {
                btn_Delete.Enabled = false;
            }
            else
            {
                btn_Delete.Enabled = true;
            }
        }
コード例 #5
0
ファイル: MoneyGiveIn.aspx.cs プロジェクト: 15831944/C-12-
        //保存
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (tb_MoneyNum.Text.Trim() == "")
                {
                    Alert.ShowInTop("每项用途所用金额不能为空!");
                    tb_MoneyNum.Text = "";
                    return;
                }
                Common.Entities.Project project = pro.IsNullProject(tb_SourceWork.Text.Trim());
                if (project == null)
                {
                    tb_SourceWork.Text = "";
                    Alert.ShowInTop("无此项目,请检查输入!");
                    return;
                }
                else if (project.IsPass == false)
                {
                    tb_SourceWork.Text = "";
                    Alert.ShowInTop("此项目正在审核中,请联系管理员!");
                    return;
                }
                double num = 0.0;
                if (!double.TryParse(tb_MoneyNum.Text.Trim(), out num))
                {
                    tb_MoneyNum.Reset();
                    Alert.ShowInTop("请输入数字!");
                    return;
                }

                if (dp_Time.SelectedDate == null)
                {
                    Alert.ShowInTop("请选择日期!");
                    return;
                }
                Common.Entities.FundInformation fun = new Common.Entities.FundInformation();
                Common.Entities.OperationLog    op  = new Common.Entities.OperationLog();

                fun.BudgetDirector = tb_UserInfo.Text.Trim();
                BLHelper.BLLUser user     = new BLHelper.BLLUser();
                string           username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                fun.EntryPerson            = username;
                fun.EveItemUseMoney        = tb_MoneyNum.Text.Trim();
                fun.FundingPurposeSortName = ddl_FundingPurposeSortID.Text;
                fun.OperateType            = "支出";
                fun.ProjectID    = project.ProjectID;
                fun.SecrecyLevel = Convert.ToInt32(DropDownListLevel.SelectedValue) + 1;
                fun.Time         = dp_Time.SelectedDate;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    fun.IsPass = true;
                    fund.Insert(fun);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                }
                else
                {
                    fun.IsPass = false;
                    fund.Insert(fun);
                    op.LoginIP          = " ";
                    op.LoginName        = Session["LoginName"].ToString();
                    op.OperationContent = "FundInformation";
                    op.OperationDataID  = fun.FundInformationID;
                    op.OperationTime    = DateTime.Now;
                    op.OperationType    = "添加";
                    blop.Insert(op);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("数据已经提交,请等待管理员确认!"));
                }
            }
            catch (Exception ex)
            {
                BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
            }
        }
コード例 #6
0
ファイル: WorkAdd.aspx.cs プロジェクト: 15831944/C-12-
        //保存机构信息
        protected void Save_Click(object sender, EventArgs e)
        {
            try
            {
                if (AgencyName2.Text.Trim() == "")
                {
                    Alert.ShowInTop("机构名称不能为空!");
                    AgencyName2.Text = "";
                    return;
                }
                if (AgencyHeads2.Text.Trim() == "")
                {
                    Alert.ShowInTop("机构负责人不能为空!");
                    AgencyHeads2.Text = "";
                    return;
                }
                if (FullTimeNumber2.Text.Trim() == "")
                {
                    Alert.ShowInTop("专职人数不能为空!");
                    FullTimeNumber2.Text = "";
                    return;
                }
                Common.Entities.Agency       ag   = new Common.Entities.Agency();
                Common.Entities.OperationLog op   = new Common.Entities.OperationLog();
                BLHelper.BLLOperationLog     blop = new BLHelper.BLLOperationLog();
                BLHelper.BLLUser             user = new BLHelper.BLLUser();
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;

                ag.AgencyName      = AgencyName2.Text.ToString();
                ag.ParentID        = agen.SelectAgencyID(ParentID2.Text.ToString());
                ag.SecrecyLevel    = Convert.ToInt32(DroSecrecyLevel.SelectedIndex + 1);
                ag.AgencyHeads     = AgencyHeads2.Text.ToString();
                ag.Research        = Research2.Text.ToString();
                ag.AgencyNumber    = DroAgencyNumber.SelectedText;
                ag.FullTimeNumbers = Convert.ToInt32(FullTimeNumber2.Text.ToString());
                ag.PartTimeNumbers = Convert.ToInt32(PartTimeNumber2.Text.ToString());
                ag.Area            = Area2.Text.ToString();
                ag.IsGlobal        = ddl_glo.SelectedText.Trim();
                ag.Location        = Location2.Text.ToString();
                ag.EntryPerson     = username;
                if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
                {
                    ag.IsPass = true;
                    agen.Insert(ag);
                    PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("保存成功") + Alert.GetShowInTopReference("保存成功"));
                }
                else
                {
                    ag.IsPass = false;
                    agen.Insert(ag);
                    op.LoginIP          = "";
                    op.LoginName        = Session["LoginName"].ToString();
                    op.OperationContent = "Agency";
                    op.OperationDataID  = agen.SelectAgencyID(AgencyName2.Text.Trim().ToString());
                    op.OperationType    = "添加";
                    op.OperationTime    = DateTime.Now;
                    blop.Insert(op);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("您的操作已经提交,请等待管理员确认!"));
                }
            }

            catch (Exception ex)
            {
                BLCommon.PublicMethod pm = new BLCommon.PublicMethod();
                pm.SaveError(ex, this.Request);
            }
        }
コード例 #7
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            BLCommon.PublicMethod pm   = new BLCommon.PublicMethod();
            BLHelper.BLLUser      user = new BLHelper.BLLUser();
            try
            {
                if (tName.Text.Trim() == "")
                {
                    Alert.ShowInTop("姓名不能为空!");
                    tName.Text = "";
                    return;
                }
                if (tLearnPlace.Text.Trim() == "")
                {
                    Alert.ShowInTop("进修地点不能为空!");
                    tLearnPlace.Text = "";
                    return;
                }
                if (tLearnSchool.Text.Trim() == "")
                {
                    Alert.ShowInTop("进修学校不能为空!");
                    tLearnSchool.Text = "";
                    return;
                }
                if (tLearnContent.Text.Trim() == "")
                {
                    Alert.ShowInTop("进修内容不能为空!");
                    tLearnContent.Text = "";
                    return;
                }

                if (dLearnEndTime.SelectedDate < dLearnBeginTime.SelectedDate)
                {
                    Alert.ShowInTop("结束时间不能小于开始时间!");
                    return;
                }
                BLHelper.BLLAgency       agency = new BLHelper.BLLAgency();
                OperationLog             op     = new OperationLog();
                BLHelper.BLLOperationLog blop   = new BLHelper.BLLOperationLog();

                fu.Name = tName.Text.Trim();
                if (dBirthday.SelectedDate != null)
                {
                    fu.Birthday = Convert.ToDateTime(dBirthday.Text.Trim());
                }
                fu.DocuType       = tDocuType.SelectedText.Trim();
                fu.IDNum          = tIDNum.Text.Trim();
                fu.Email          = tEmail.Text.Trim();
                fu.Hometown       = tHometown.Text.Trim();
                fu.LearnBeginTime = dLearnBeginTime.SelectedDate;
                fu.LearnContent   = tLearnContent.Text.Trim();
                if (dLearnEndTime.SelectedDate != null)
                {
                    fu.LearnEndTime = dLearnEndTime.SelectedDate;
                }
                fu.LearnPlace  = tLearnPlace.Text.Trim();
                fu.LearnSchool = tLearnSchool.Text.Trim();
                fu.PhoneNum    = tPhoneNum.Text.Trim();
                fu.Profile     = tPintroduce.Text.Trim();
                fu.Remark      = tRemark.Text.Trim();

                fu.SecrecyLevel = Convert.ToInt32(DroSecrecyLevel.SelectedValue.Trim()) + 1;

                if (rbtnBoy.Checked == true)
                {
                    fu.Sex = true;
                }
                else
                {
                    fu.Sex = false;
                }

                fu.AgencyID = agency.SelectAgencyID(DropDownListAgency.SelectedText);
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                fu.EntryPerson = username;

                if (Convert.ToInt32(Session["SecrecyLevel"].ToString()) == 5)
                {
                    fu.IsPass = true;
                    futherstudy.Insert(fu);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功!"));
                }
                else
                {
                    fu.IsPass = false;
                    futherstudy.Insert(fu);
                    op.LoginIP          = "";
                    op.LoginName        = Session["LoginName"].ToString();
                    op.OperationContent = "FutherStudy";
                    op.OperationDataID  = futherstudy.FindIdByNT(tName.Text.Trim().ToString(), dLearnBeginTime.SelectedDate.Value);
                    op.OperationType    = "添加";
                    op.OperationTime    = DateTime.Now;
                    blop.Insert(op);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference() + Alert.GetShowInTopReference("数据已经提交,请等待管理员确认!"));
                }
            }
            catch (Exception ex)
            {
                pm.SaveError(ex, this.Request);
            }
        }
コード例 #8
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            BLHelper.BLLFurniture    blfurni = new BLHelper.BLLFurniture();
            BLHelper.BLLUser         user    = new BLHelper.BLLUser();
            BLHelper.BLLAgency       agency  = new BLHelper.BLLAgency();
            BLHelper.BLLOperationLog op      = new BLHelper.BLLOperationLog();

            Common.Entities.Furniture    furniture = new Common.Entities.Furniture();
            Common.Entities.OperationLog log       = new Common.Entities.OperationLog();
            try
            {
                if (string.IsNullOrEmpty(tb_FurnitureName.Text.Trim()))
                {
                    Alert.ShowInTop("请填写家具名称!");
                    return;
                }
                furniture.FurnitureName = tb_FurnitureName.Text.Trim();
                if (ddl_isgov.SelectedIndex == 0)
                {
                    furniture.IsGowerProcu = true;
                }
                else
                {
                    furniture.IsGowerProcu = false;
                }
                if (ddl_isshare.SelectedIndex == 0)
                {
                    furniture.IsShare = true;
                }
                else
                {
                    furniture.IsShare = false;
                }
                //furniture.AgencName = tb_Agency.Text.Trim();
                furniture.AgencName = ddl_Agency.SelectedText;

                furniture.CategoryName    = "无";
                furniture.CategoryName    = ddl_Category.SelectedText.Trim();
                furniture.ClassNum        = tb_ClassNum.Text.Trim();
                furniture.EquipNum        = tb_Equipnum.Text.Trim();
                furniture.Manufacturer    = tb_Manufacturer.Text.Trim();
                furniture.MeasurementUnit = tb_MeasurementUnit.Text.Trim();
                furniture.Model           = tb_Model.Text.Trim();
                furniture.Remarks         = tb_Remarks.Text.Trim();
                furniture.StorageLocation = tb_StorageLocation.Text.Trim();


                furniture.Price        = tb_price.Text.Trim();
                furniture.Purchase     = tb_Purchase.Text.Trim();
                furniture.PurchaseTime = dp_PurchaseTime.SelectedDate.Value;
                furniture.UsePerson    = tb_UsePerson.Text.Trim();
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                furniture.EntryPerson  = username;
                furniture.SecrecyLevel = Convert.ToInt32(ddl_Level.SelectedIndex + 1);

                //furniture.AgencyID = agency.SelectAgencyID(ddl_agencyname.SelectedText.Trim());
                if (Convert.ToInt32(Session["SecrecyLevel"]) < 5)
                {
                    log.LoginName        = username;
                    log.OperationTime    = DateTime.Now;
                    log.LoginIP          = " ";
                    log.OperationContent = "Furnitures";
                    log.OperationType    = "添加";
                    furniture.IsPass     = false;

                    blfurni.Insert(furniture);//插入家具表
                    log.OperationDataID = furniture.FurnitureID;
                    op.Insert(log);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待审核!"));
                }
                else
                {
                    furniture.IsPass = true;
                    blfurni.Insert(furniture);//插入家具表
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功"));
                }
            }
            catch (Exception ex)
            {
                Alert.ShowInTop("保存出错,请联系管理员!");
                pm.SaveError(ex, this.Request);
            }
        }
コード例 #9
0
        //保存
        protected void Save_Click(object sender, EventArgs e)
        {
            BLHelper.BLLEquipment    blequip = new BLHelper.BLLEquipment();
            BLHelper.BLLUser         user    = new BLHelper.BLLUser();
            BLHelper.BLLAgency       agency  = new BLHelper.BLLAgency();
            BLHelper.BLLOperationLog op      = new BLHelper.BLLOperationLog();

            Common.Entities.Equipment    Equipment = new Common.Entities.Equipment();
            Common.Entities.OperationLog log       = new Common.Entities.OperationLog();
            try
            {
                //if (string.IsNullOrEmpty(tb_EquipmenteName.Text.Trim()))
                //{
                //    Alert.ShowInTop("请填写设备名称!");
                //    return;
                //}
                Equipment.EquipmentName = tb_EquipmenteName.Text.Trim();
                if (ddl_isgov.SelectedIndex == 0)
                {
                    Equipment.IsGowerProcu = true;
                }
                else
                {
                    Equipment.IsGowerProcu = false;
                }
                if (ddl_isshare.SelectedIndex == 0)
                {
                    Equipment.IsShare = true;
                }
                else
                {
                    Equipment.IsShare = false;
                }
                Equipment.Price        = tb_price.Text.Trim();
                Equipment.Purchase     = tb_Purchase.Text.Trim();
                Equipment.PurchaseTime = dp_PurchaseTime.SelectedDate;
                Equipment.UsePerson    = tb_UsePerson.Text.Trim();
                Equipment.EquipNum     = tb_Equipnum.Text.Trim();
                string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
                Equipment.EntryPerson  = username;
                Equipment.SecrecyLevel = Convert.ToInt32(DropDownListSecrecyLevel.SelectedIndex + 1);
                //Equipment.AgencyID = agency.SelectAgencyID(ddl_agencyname.SelectedText.Trim());
                //Equipment.AgencName = tb_Agency.Text.Trim();
                Equipment.AgencName       = ddl_Agency.SelectedText;
                Equipment.CategoryName    = "无";
                Equipment.CategoryName    = ddl_Category.SelectedText;
                Equipment.ClassNum        = tb_ClassNum.Text.Trim();
                Equipment.Manufacturer    = tb_Manufacturer.Text.Trim();
                Equipment.MeasurementUnit = tb_MeasurementUnit.Text.Trim();
                Equipment.Model           = tb_Model.Text.Trim();
                Equipment.Remarks         = tb_Remarks.Text.Trim();
                Equipment.StorageLocation = tb_StorageLocation.Text.Trim();
                if (Convert.ToInt32(Session["SecrecyLevel"]) < 5)
                {
                    log.LoginName        = username;
                    log.OperationTime    = DateTime.Now;
                    log.LoginIP          = " ";
                    log.OperationContent = "Equipments";
                    log.OperationType    = "更新";
                    Equipment.IsPass     = false;

                    blequip.Insert(Equipment);//插入设备表
                    log.OperationDataID = Convert.ToInt32(Session["EquipmentID"]);
                    log.Remark          = Convert.ToString(Equipment.EquipmentID);
                    op.Insert(log);
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("您的数据已提交,请等待审核!"));
                }
                else
                {
                    Equipment.IsPass      = true;
                    Equipment.EquipmentID = Convert.ToInt32(Session["EquipmentID"]);
                    blequip.Update(Equipment);//更新设备表
                    PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHideRefreshReference() + Alert.GetShowInTopReference("保存成功"));
                }
            }
            catch (Exception ex)
            {
                Alert.ShowInTop("保存出错,请联系管理员!");
                pm.SaveError(ex, this.Request);
            }
        }