protected void lbtnDelete_Click(object sender, EventArgs e) { string id = ((LinkButton)sender).CommandArgument; try { TheProductLineUserMgr.DeleteProductLineUser(Int32.Parse(id)); ShowSuccessMessage("Mes.ProductLineUser.Delete.Successfully"); UpdateView(); } catch (Castle.Facilities.NHibernateIntegration.DataException ex) { ShowErrorMessage("Mes.ProductLineUser.Delete.Fail"); } }
protected void ToInBT_Click(object sender, EventArgs e) { List <Flow> pList = new List <Flow>(); foreach (ListItem item in this.CBL_NotInProductLine.Items) { if (item.Selected) { ProductLineUser pu = new ProductLineUser(); pu.DeliveryUser = TheUserMgr.LoadUser(this.tbUser.Text.Trim()); pu.ProductLine = TheFlowMgr.LoadFlow(item.Value); TheProductLineUserMgr.CreateProductLineUser(pu); } } this.CBL_NotInProductLine.DataBind(); this.CBL_InProductLine.DataBind(); this.cb_InProductLine.Checked = false; this.cb_NotInProductLine.Checked = false; }
protected void ToOutBT_Click(object sender, EventArgs e) { List <ProductLineUser> upList = new List <ProductLineUser>(); foreach (ListItem item in this.CBL_InProductLine.Items) { if (item.Selected) { ProductLineUser userProductLine = TheProductLineUserMgr.LoadProductLineUser(this.tbUser.Text.Trim(), item.Value); upList.Add(userProductLine); } } if (upList.Count > 0) { TheProductLineUserMgr.DeleteProductLineUser(upList); } this.CBL_NotInProductLine.DataBind(); this.CBL_InProductLine.DataBind(); this.cb_InProductLine.Checked = false; this.cb_NotInProductLine.Checked = false; }