/// <summary> /// 检验登录信息 /// </summary> /// <param name="login">登录信息</param> /// <returns>登录信息,Message为null时登录成功。</returns> public LoginInfo IsLogin(LoginInfo login) { try { login.PassWord = LAF.Common.Encrypt.DESEncrypt.Encrypt(login.PassWord); login = new LoginDAL().IsLogin(login); if (login == null) { return(login); } //获取所在班组 List <WorkGroup> wgList = new WorkGroupBLL().GetList(); if (wgList.Count > 0) { login.WorkGroupID = wgList[0].PID; } return(login); } catch (Exception ex) { throw; } }
protected void btSave_Click(object sender, EventArgs e) { WorkGroup info = new WorkGroup(); WorkGroupBLL bll = null; try { UIBindHelper.BindModelByControls(this.Page, info); info.Details = LAF.Common.Serialization.JsonConvertHelper.DeserializeObject <List <WorkGroupRef> >(this.hiPList.Value); bll = BLLFactory.CreateBLL <WorkGroupBLL>(); if (this.hiID.Value == "") { bll.Insert(info); } else { info.CREATEUSER = this.HiCREATEUSER.Value; info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value); info.PID = this.hiID.Value; bll.Update(info); } ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true); } catch (Exception ex) { throw ex; } }
protected void btDelete_Click(object sender, EventArgs e) { ArrayList pkArray = null; WorkGroupBLL bll = null; try { bll = BLLFactory.CreateBLL <WorkGroupBLL>(); pkArray = GvHelper.GetPKValueByChk(this.GvList, 0, "cbxSelect", 0); foreach (object key in pkArray) { if (!bll.HasProducePlan(key.ToString())) { bll.DeleteWorkGroup(new WorkGroup { PID = key.ToString() }); } else { ClientScript.RegisterStartupScript(this.GetType(), "myjs", "alert('选中的班组在排班中使用过,不能被删除');", true); } } this.BindData(); } catch (Exception ex) { throw ex; } }
private void BindData() { WorkGroupBLL bll = null; DataPage dp = new DataPage(); WorkGroup condition = new WorkGroup(); try { bll = BLLFactory.CreateBLL <WorkGroupBLL>(); condition.PNAME = this.PNAME.Text; PagerHelper.InitPageControl(this.AspNetPager1, dp, true); dp = bll.GetList(condition, dp); List <WorkGroup> list = dp.Result as List <WorkGroup>; this.GvList.DataSource = list; this.GvList.DataBind(); for (int i = 0; i < this.GvList.Rows.Count; i++) { string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["PID"].ToString()); (this.GvList.Rows[i].Cells[5].Controls[0] as WebControl).Attributes.Add("onclick", click); } PagerHelper.SetPageControl(AspNetPager1, dp, true); } catch (Exception ex) { throw ex; } }
private void BindWorkGroup() { WorkGroupBLL bll = null; List <WorkGroup> array = null; bll = BLLFactory.CreateBLL <WorkGroupBLL>(); array = bll.GetList(); this.WOID.DataSource = array; this.WOID.DataBind(); }
protected void btSave_Click(object sender, EventArgs e) { WorkGroupRef info = new WorkGroupRef(); WorkGroupBLL bll = null; try { UIBindHelper.BindModelByControls(this.Page, info); bll = BLLFactory.CreateBLL <WorkGroupBLL>(); bll.InsertRef(info); ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true); } catch (Exception ex) { throw ex; } }
private void BindData() { string id = Request.QueryString["id"]; WorkGroupBLL bll = null; WorkGroup info = new WorkGroup(); DataGridResult <WorkGroupRef> pList = new DataGridResult <WorkGroupRef>(); try { bll = BLLFactory.CreateBLL <WorkGroupBLL>(); if (string.IsNullOrEmpty(id) == false) { info.PID = id; info = bll.Get(info); UIBindHelper.BindForm(this.Page, info); this.hiID.Value = info.PID; this.HiCREATEUSER.Value = info.CREATEUSER; this.HiCREATETIME.Value = info.CREATETIME.ToString(); List <WorkGroupRef> list = bll.GetPList(id); pList.Total = list.Count; pList.Rows = list; } else { info = new WorkGroup(); pList.Total = 0; pList.Rows = new List <WorkGroupRef>(); } this.hiPList.Value = pList.GetJsonSource(); } catch (Exception ex) { throw ex; } }