Пример #1
0
 //删除
 protected void btn_Delete_Click(object sender, EventArgs e)
 {
     BLHelper.BLLPaper        paper = new BLHelper.BLLPaper();
     BLHelper.BLLAttachment   blat  = new BLHelper.BLLAttachment();
     BLHelper.BLLOperationLog op    = new BLHelper.BLLOperationLog();
     try
     {
         int count = pm.GridCount(Grid_Paper, CBoxSelect).Count();
         if (count <= 0)
         {
             Alert.ShowInTop("请至少选择一项!");
             return;
         }
         string username = user.FindByLoginName(Session["LoginName"].ToString()).UserName;
         if (Convert.ToInt32(Session["SecrecyLevel"]) == 5)
         {
             for (int i = 0; i < pm.GridCount(Grid_Paper, CBoxSelect).Count(); i++)
             {
                 paper.Delete(Convert.ToInt32(Grid_Paper.DataKeys[pm.GridCount(Grid_Paper, CBoxSelect)[i]][0].ToString()));
             }
             InitData();
             Alert.ShowInTop("删除数据成功!");
             btn_Delete.Enabled = false;
         }
         else
         {
             Common.Entities.OperationLog operate = new OperationLog();
             for (int i = 0; i < pm.GridCount(Grid_Paper, CBoxSelect).Count(); i++)
             {
                 paper.UpdateIsPass(Convert.ToInt32(Grid_Paper.DataKeys[pm.GridCount(Grid_Paper, CBoxSelect)[i]][0]), false);
                 operate.LoginName        = username;
                 operate.OperationTime    = DateTime.Now;
                 operate.LoginIP          = " ";
                 operate.OperationContent = "Files";
                 operate.OperationType    = "删除";
                 operate.OperationDataID  = Convert.ToInt32(Grid_Paper.DataKeys[pm.GridCount(Grid_Paper, CBoxSelect)[i]][0]);
                 op.Insert(operate);
             }
             InitData();
             Alert.ShowInTop("您的数据已提交,请等待确认!");
         }
     }
     catch (Exception ex)
     {
         pm.SaveError(ex, this.Request);
         Alert.ShowInTop("删除失败,请联系管理员!");
     }
 }
Пример #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 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);
            }
        }
Пример #4
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);
            }
        }
Пример #5
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);
            }
        }
Пример #6
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);
            }
        }