protected void Databang() { object action = Request.QueryString["action"]; if (action != null) { if (action.ToString().Equals("edit")) { int SubClassID = Int16.Parse(Request.QueryString["SubClassID"].ToString()); UserTypeSubClass s = new UserTypeSubClass(); s = Leyp.SQLServerDAL.Factory.getUserTypeSubClassDAL().getByID(SubClassID); SubTypeName.Text = s.SubClassName; Pageaction.Text = "edit"; editSubClassID.Text = SubClassID.ToString(); UserTypeDropDownList.Visible = false; } else if (action.ToString().Equals("del")) { int SubClassID = Int16.Parse(Request.QueryString["SubClassID"].ToString()); if (Leyp.SQLServerDAL.Factory.getUserTypeSubClassDAL().deleteNode(SubClassID)) { addSystemLog("成功删除用户类型ID" + SubClassID); Jscript.AjaxAlert(this, " 删除成功"); } else { Jscript.AjaxAlert(this, " 用户已经使用!不能删除!"); } } } listDatabang(); userTypeBand(); }
protected void AddSubmit_Click(object sender, EventArgs e) { string str = SalesOutID.Text.ToString(); Jscript.AjaxAlert(this, str); return; }
protected void btnSubmit_Click(object sender, EventArgs e) { string NewTypeid = NewType.SelectedValue.ToString(); if (NewTypeid.Equals("a")) { Jscript.AjaxAlert(this, "请选择信息类型"); return; } string Infos = contents.Text.Trim(); string Titles = txtTitle.Text.ToString(); Notice n = new Notice(); n.CreateDate = DateTime.Now.ToString("yyyy-MM-dd"); n.Info = Infos; n.Title = Titles; n.Type = int.Parse(NewTypeid); n.UserName = getUserName(); Leyp.SQLServerDAL.Factory.getNoticeDAL().insertNewEntity(n); txtTitle.Text = ""; contents.Text = ""; Jscript.AjaxAlert(this, "添加成功"); }
/// <summary> /// 提交新群组 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void submit_Click(object sender, EventArgs e) { string strName = GroupName_New.Text.ToString(); string strDesc = Description_new.Text.ToString(); if (strName.Length < 2) { Jscript.AjaxAlert(this, "群名称不能为空"); return; } else { Group gp = new Group(); gp.GroupName = strName; gp.Description = strDesc; if (Leyp.SQLServerDAL.Factory.getGroupDAL().insertNewGroup(gp)) { HyperLink1.Visible = true; viewPanel.Visible = false; addSystemLog("新添群组" + strName); } else { HyperLink1.Text = "添加失败!可能是名称重复了!你可以返回重新试试"; HyperLink1.Visible = true; viewPanel.Visible = false; } } }
protected void init() { object action = Request.QueryString["action"]; if (action != null) { if (action.ToString().Equals("edit")) { int ID = Int16.Parse(Request.QueryString["ID"].ToString()); StoreHouse s = new StoreHouse(); s = Leyp.SQLServerDAL.Factory.getStoreHouseDAL().getByHouseID(ID); SubareaName.Text = s.HouseName; Pageaction.Text = "edit"; editID.Text = ID.ToString(); Description.Text = s.Description; } else if (action.ToString().Equals("del")) { int ID = Int16.Parse(Request.QueryString["ID"].ToString()); if (!Leyp.SQLServerDAL.Factory.getStoreHouseDAL().deleteEitity(ID)) { Jscript.AjaxAlert(this, "删除失败!可能记录正在使用"); Response.Redirect("StoreHouseManager.aspx", true); } } } DataBand(); }
///// <summary> ///// 用户查询 ///// </summary> ///// <param name="sender"></param> ///// <param name="e"></param> //protected void SearchButton_Click(object sender, EventArgs e) //{ // string strName = ""; // int strUserType =0; // string strSubClass =""; // Response.Redirect(string.Format("SysUserSearch.aspx?UserName={0}&UserTypeID={1}&SubClassID={2}", strName, strUserType, strSubClass)); //} protected void Add_Submit_Click(object sender, EventArgs e) { string strName = UserName.Text.ToString(); string strPwd = PassWord.Text.ToString(); string strRname = RealName.Text.ToString(); int typeid = int.Parse(TypeID.SelectedValue.ToString()); string subClass = SubClassID.SelectedValue.ToString(); if (subClass.Equals("-1")) { Jscript.AjaxAlert(this, "请 选择用户类型"); return; } int groupid = int.Parse(GroupID1.Value.ToString()); string strDept = Dept.Text.ToString(); string strQQ = QQ.Text.ToString(); string strTaobao = WangWang.Text.ToString(); string strTel = Tel.Text.ToString(); string strEmail = Email.Text.ToString(); string strDesc = Description.Text.ToString(); string strState = State.SelectedValue.ToString(); string strSex = Sex.SelectedValue.ToString(); Leyp.Model.User u = new Leyp.Model.User(); u.UserName = strName; u.Password = StrHelper.EncryptPassword(strPwd, StrHelper.PasswordType.MD5);//MD5加密 u.Description = strDesc; u.Email = strEmail; u.GroupID = groupid; u.TypeID = typeid; u.QQ = strQQ; u.RealName = strRname; u.Sex = strSex; u.State = strState; u.WangWang = strTaobao; u.Tel = strTel; u.Dept = strDept; u.BankAccount = BankAccount.Text.ToString(); u.Bankname = Bankname.Text.ToString(); u.Character = Character.Text.ToString(); u.CompanyInfo = CompanyInfo.Text.ToString(); u.CompanyName = CompanyName.Text.ToString(); u.Address = Address.Text.ToString(); u.SubClassID = int.Parse(SubClassID.SelectedValue.ToString()); u.LatelyLogin = ""; if (Leyp.SQLServerDAL.Factory.getUserDAL().insertNewUser(u)) { Panel1.Visible = false; HyperLink1.Visible = true; } else { Panel1.Visible = false; HyperLink1.Text = "添加失败!可能用户名已经存在!请重新注册"; HyperLink1.Visible = true; } }
/// <summary> /// 更新时 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void PriceList_RowUpdating(object sender, GridViewUpdateEventArgs e) { string price = ((TextBox)PriceList.Rows[e.RowIndex].Cells[1].FindControl("TextBox1")).Text.ToString(); // int typeid = int.Parse(PriceList.DataKeys[e.RowIndex]["SubClassID"].ToString()); int subID = int.Parse(PriceList.DataKeys[e.RowIndex]["SubClassID"].ToString()); int proID = int.Parse(PID.Text.ToString()); double ps; try { ps = double.Parse(price); } catch { Jscript.AjaxAlert(this, "输入有误!"); PriceList.EditIndex = -1; DataBand(); return; } ProductsUserType p = new ProductsUserType(); p.Price = ps; p.ProductsID = proID; p.SubClassID = subID; Leyp.SQLServerDAL.Factory.getProductsUserTypeDAL().updateNodeupdate(p); addSystemLog("商品ID:" + proID + " 调价成功"); PriceList.EditIndex = -1; DataBand(); }
protected void initDataBand() { try { string ProductsID = Request.QueryString["ProductsID"].ToString(); PID.Text = ProductsID.ToString(); if (Request.QueryString["action"].ToString().Equals("view")) { ListBand(int.Parse(ProductsID)); } else if (Request.QueryString["action"].ToString().Equals("del")) { string ID = Request.QueryString["ID"].ToString(); if (Leyp.SQLServerDAL.Factory.getProductsPhotoDAL().deleteNodeByID(int.Parse(ID))) { Jscript.AjaxAlert(this, "删除成功!"); ListBand(int.Parse(ProductsID)); } } } catch { Response.Write("输入有误"); Response.End(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (ServiceTypeDropDownList1.SelectedValue.ToString().Equals("")) { Jscript.AjaxAlert(this, "请选择类型"); return; } ServiceInfo s = new ServiceInfo(); s.CreateDate = DateTime.Now.ToString("yyyy-MM-dd"); s.Content = Content.Text; s.ServiceTitle = ServiceTitle.Text; s.UserName = getUserName(); s.TypeID = int.Parse(ServiceTypeDropDownList1.SelectedValue.ToString()); if (SalesOrderID.Text.ToString().Equals("")) { s.SalesOrderID = "无"; } else { s.SalesOrderID = SalesOrderID.Text.ToString(); } if (Leyp.SQLServerDAL.Factory.getServiceInfoDAL().insertNewEntity(s)) { Panel1.Visible = false; Panel2.Visible = true; } }
protected void Select_Click(object sender, EventArgs e) { if (ProductsID.Text.ToString().Equals("")) { Jscript.AjaxAlert(this, "请输入商品编号"); } DataBandinit(ProductsID.Text.ToString()); }
protected void NextButton_Click(object sender, EventArgs e) { if (int.Parse(UpperLimit.Text.ToString()) < int.Parse(LowerLimit.Text.ToString())) { Jscript.AjaxAlert(this, "库存上限应该大于下限!"); return; } Products p = new Products(); p.ProductsName = ProductsName.Text.ToString(); try { p.TypeID = int.Parse(ProductsTypeDropDownList1.SelectedValue.ToString()); p.BrandID = int.Parse(ProductsBrandDropDownList1.SelectedValue.ToString()); } catch { Jscript.AjaxAlert(this, "请正确选择 商品品牌 和 商品类型"); return; } p.Color = getStrValue(Color.Text.ToString()); p.Weight = getStrValue(Weight.Text.ToString()); p.Spec = getStrValue(Spec.Text.ToString()); p.Cost = float.Parse(Cost.Text.ToString()); p.ProductsUints = getStrValue(ProductsUints.Text.ToString()); p.Material = getStrValue(Material.Text.ToString()); p.UpperLimit = int.Parse(UpperLimit.Text.ToString()); p.LowerLimit = int.Parse(LowerLimit.Text.ToString()); p.BeginEnterDate = getStrValue(BeginEnterDate.Text.ToString()); p.FinalEnterDate = getStrValue(FinalEnterDate.Text.ToString()); p.LatelyOFSDate = getStrValue(LatelyOFSDate.Text.ToString()); p.LoadingDate = getStrValue(LoadingDate.Text.ToString()); p.UnshelveDate = getStrValue(UnshelveDate.Text.ToString()); p.Description = getStrValue(Description.Text.ToString()); p.ProductsID = int.Parse(PID.Text.ToString()); p.Price = float.Parse(Price.Text.ToString()); if (Leyp.SQLServerDAL.Factory.getProductsDAL().updateProducts(p)) { addSystemLog("商品ID:" + PID.Text.ToString() + " 修改成功"); HyperLink1.Visible = true; Panel2.Visible = true; Panel1.Visible = false; } else { HyperLink1.Text = "修改失败!"; HyperLink1.Visible = true; Panel2.Visible = true; Panel1.Visible = false; } }
protected void DataBand() { object action = Request.QueryString["action"]; if (action == null) { addPanel.Visible = false; DataGridViewBand(); } else if (action.ToString().Equals("add")) { ViewPanel.Visible = false; } else if (action.ToString().Equals("edit")) { //try //{ string supplierID = Request.QueryString["SupplierID"].ToString(); Supplier sp = new Supplier(); sp = Leyp.SQLServerDAL.Factory.getSupplierDAL().getBySupplierID(int.Parse(supplierID)); SupplierName.Text = sp.SupplierName; Area.Text = sp.Area; Postcode.Text = sp.Postcode; Address.Text = sp.Address; Linkman.Text = sp.Linkman; Tel.Text = sp.Tel; WebUrl.Text = sp.WebUrl; Email.Text = sp.Email; // Bankname.Text = sp.Bankname; //BankAccount.Text = sp.BankAccount; TaxNum.Text = sp.TaxNum; CreateDate.Text = sp.CreateDate; Description.Text = sp.Description; act.Text = "edit"; SupplierIDs.Text = supplierID; ViewPanel.Visible = false; //} //catch //{ // Response.Write("输入有误!"); // Response.End(); //} } else if (action.ToString().Equals("del")) { string supplierID = Request.QueryString["SupplierID"].ToString(); Jscript.AjaxAlert(this, "有待解决"); DataGridViewBand(); } }
protected void Button1_Click(object sender, EventArgs e) { if (ProductsID.Text.ToString().Equals("")) { Jscript.AjaxAlert(this, "请输入商品编号"); return; } Response.Redirect("PiePruducts.aspx?ProductsID=" + ProductsID.Text.ToString()); }
protected void StoreHouseDropDownList_SelectedIndexChanged(object sender, EventArgs e) { try { int id0 = int.Parse(StoreHouseDropDownList.SelectedValue.ToString()); SubareaNameInit(id0); } catch { Jscript.AjaxAlert(this, "请选择库区"); return; } }
protected void AddButton_Click(object sender, EventArgs e) { if (side.Text.ToString().Equals("old")) { return; } else { string str0 = getStringText(BuyOrderID.Text.ToString()); string str1 = getStringText(BuyOrderDate.Text.ToString()); string str2 = getStringText(Delegate.Text.ToString()); int storeHouseID = int.Parse(StoreHouseID.Text.ToString()); int houseDetailID = int.Parse(HouseDetailID.Text.ToString()); string str3 = getStringText(SignDate.Text.ToString()); string str4 = getStringText(TradeDate.Text.ToString()); string str5 = getStringText(TradeAddress.Text.ToString()); float totalPrice = float.Parse(TotalPrice.Text.ToString()); string str6 = getStringText(Description.Text.ToString()); BuyOrder b = new BuyOrder(); b.BuyOrderID = str0; b.BuyOrderDate = str1; b.Delegate = str2; b.Description = str6; b.HouseDetailID = houseDetailID; b.Identitys = 0; //采购订单 b.SignDate = str3; b.State = 0; //未审核 b.StoreHouseID = storeHouseID; b.TotalPrice = totalPrice; b.TradeAddress = str5; b.TradeDate = str4; b.UserName = getUserName(); if (Leyp.SQLServerDAL.Buy.Factory.getBuyOrderDAL().insertNewEntity(b)) { side.Text = "old"; Button1.Visible = true; Image1.ImageUrl = "../images/Good.gif"; Label1.Text = "表头已经保存"; AddButton.Visible = false; Jscript.AjaxAlert(this, "添加成功!"); return; } else { Jscript.AjaxAlert(this, "添加失败!"); return; } } }
protected void btnSubmit_Click(object sender, EventArgs e) { Jscript.AjaxAlert(this, "建设中"); //PhotoFlow p = new PhotoFlow(); //p.FlowTitle = txtTitle.Text.ToString(); //p.UserName = getUserName(); //p.Content = content.Value.ToString(); //p.CreateDate = DateTime.Now.ToString("yyyy-MM-dd"); //p.State = 0; //Leyp.SQLServerDAL.Factory.getPhotoFlowDAL().insertNewEntity(p); //Jscript.AjaxAlert(this, "添加成功"); //return; }
/// <summary> /// 页面初始化 /// </summary> public void initDataBand() { string action = Request.QueryString["action"]; if (action == null) { CollectionPager1.DataSource = Leyp.SQLServerDAL.Sales.Factory.getSalesPlatformDAL().getList();//BLL项目中List数据源 CollectionPager1.BindToControl = GridView1; GridView1.DataSource = CollectionPager1.DataSourcePaged; editPanel.Visible = false; } else if (action.Equals("edit")) { int PlatformID = 0; try { PlatformID = int.Parse(Request.QueryString["PlatformID"].ToString()); } catch { Response.Write("参数有误"); Response.End(); } SalesPlatform s = new SalesPlatform(); s = Leyp.SQLServerDAL.Sales.Factory.getSalesPlatformDAL().getByID(PlatformID); ShopName_edit.Text = s.PlatformName; EditID.Text = s.PlatformID.ToString();//保存编辑ID Description_edit.Text = s.Description; editPanel.Visible = true; viewPanel.Visible = false; } else if (action.Equals("del")) { int PlatformID = 0; try { PlatformID = int.Parse(Request.QueryString["PlatformID"].ToString()); } catch { Response.Write("参数有误"); Response.End(); } Leyp.SQLServerDAL.Sales.Factory.getSalesPlatformDAL().deleteEitity(PlatformID); Jscript.AjaxAlert(this, "删除成功"); viewPanel.Visible = false; } }
protected void Button1_Click(object sender, EventArgs e) { if (!checkAuthority()) { Jscript.AjaxAlert(this, "受理用户 和 提问者 方可留言"); return; } int id = int.Parse(IDS.Text.ToString()); string str = "<font color=\"#009900\">" + DateTime.Now.ToString("yyyy-MM-dd") + " " + getUserName() + " </font> :" + TextReplyInfo.Text.ToString() + " <br/>"; Leyp.SQLServerDAL.Factory.getServiceInfoDAL().addReplyInfo(id, str); Jscript.JavaScriptLocationHref(Request.RawUrl); }
protected void shenhe_Click(object sender, EventArgs e) { string AuditingId = SalesOutID.Text.ToString(); Leyp.SQLServerDAL.Sales.SalesOutDAL bl = new Leyp.SQLServerDAL.Sales.SalesOutDAL(); if (bl.AuditingOrder(AuditingId, getUserName(), TradeDate.Text.ToString(), Consignee.Text.ToString()))//审核 { Response.Redirect("ManagerAuditingSalesOut.aspx", true); } else { Jscript.AjaxAlert(this, "审核失败!"); return; } }
protected void Button2_Click(object sender, EventArgs e) { string idstring = DeliveryDropDownList1.SelectedValue.ToString(); if (idstring == null || idstring.Equals("")) { Jscript.AjaxAlert(this, "请选择选项!"); return; } if (Leyp.SQLServerDAL.Factory.getDeliveryDAL().updataDefault(int.Parse(idstring))) { HyperLink1.Visible = true; updateDefaultPanel.Visible = false; } }
protected void deleteButton_Click(object sender, EventArgs e) { string AuditingId = SalesOutID.Text.ToString(); Leyp.SQLServerDAL.Sales.SalesOutDAL bl = new Leyp.SQLServerDAL.Sales.SalesOutDAL(); if (bl.deleteEitity(AuditingId))//删除 { Response.Redirect("ManagerAuditingSalesOut.aspx", true); } else { Jscript.AjaxAlert(this, "删除失败!"); return; } }
protected void Button1_Click(object sender, EventArgs e) { string sid = SalesOrderID.Text.ToString(); string sInfo = info.Text.ToString(); if (Leyp.SQLServerDAL.Sales.Factory.getSalesOrderDAL().updatePayInfo(sid, sInfo)) { Response.Redirect("MySalesOrder.aspx", true); } else { Jscript.AjaxAlert(this, "操作失败!"); return; } }
protected void Button1_Click(object sender, EventArgs e) { float cost = float.Parse("0.00"); cost = float.Parse(Postage.Text.ToString()); if (Leyp.SQLServerDAL.Sales.Factory.getSalesDispatchDAL().sentUpdate(int.Parse(Label3.Text.ToString()), SentDate.Text.ToString(), int.Parse(DropDownList1.SelectedValue.ToString()), " 发货单号:" + SentNum.Text.ToString(), cost)) { Jscript.RefreshParent(Label4.Text.ToString()); Jscript.CloseWindow(); } else { Jscript.AjaxAlert(this, "操作失败!"); return; } }
protected void ImageUploader1_Uploaded(object sender, EventArgs e) { string PhotoUrl = ImageUploader1.PicSavedName; int pid = int.Parse(PID.Text.ToString()); if (Leyp.SQLServerDAL.Factory.getProductsDAL().updateProductsPhoto(pid, PhotoUrl)) { addSystemLog("商品ID:" + PID.Text.ToString() + "修改图片成功"); ImageUploader1.Visible = false; Jscript.AjaxAlert(this, "上传成功!"); return; } else { Jscript.AjaxAlert(this, "操作失败!"); return; } }
/// <summary> /// //更新权限 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void updateButton_Click(object sender, EventArgs e) { int groupid = Int16.Parse(GroupID.Text.ToString()); string str1 = GroupName_edit.Text.ToString(); string str2 = Description_edit.Text.ToString(); if (str1.Length < 1) { Jscript.AjaxAlert(this, "群名称不能为空"); return; } Group g = new Group(); g.GroupID = groupid; g.GroupName = str1; g.Description = str2; ArrayList AL = new ArrayList(); for (int i = 0; i <= AuthorityList.Rows.Count - 1; i++)//查看权限选了没有 { CheckBox cbox = (CheckBox)AuthorityList.Rows[i].FindControl("CheckBox1"); if (cbox.Checked == true) { AL.Add(i); } } int[] a = new int[AL.Count];//保存权限ID for (int i = 0; i < AL.Count; i++) { int id = Convert.ToInt32(AuthorityList.DataKeys[(int)AL[i]].Value.ToString()); //AR.Add(id); a[i] = id; } if (Leyp.SQLServerDAL.Factory.getGroupDAL().updateGroup(g, a)) { editPanel.Visible = false; HyperLink1.Visible = true; addSystemLog("群组ID" + groupid.ToString() + " 被修改"); return; } }
protected void SelectButton_Click(object sender, EventArgs e) { string Key = StrKey.Text.ToString(); if (Key == null || Key.Equals("")) { Jscript.AjaxAlert(this, "请输入关键字!"); return; } List <Supplier> list = new List <Supplier>(); list = Leyp.SQLServerDAL.Factory.getSupplierDAL().getSearchListByKey(Key); if (list.Count == 0) { Label1.Visible = true; } else { SupplierList.DataSource = list; SupplierList.DataBind(); } }
/// <summary> /// /// </summary> protected void Databang() { object action = Request.QueryString["action"]; if (action != null) { if (action.ToString().Equals("edit")) { int ID = Int16.Parse(Request.QueryString["ID"].ToString()); StoreHouseDetail s = new StoreHouseDetail(); s = Leyp.SQLServerDAL.Factory.getStoreHouseDetailDAL().getByID(ID); SubareaName.Text = s.SubareaName; Pageaction.Text = "edit"; editID.Text = ID.ToString(); StoreHouseDropDownList.Visible = false; } else if (action.ToString().Equals("del")) { //int ID = Int16.Parse(Request.QueryString["ID"].ToString()); //if (Leyp.SQLServerDAL.Factory.getStoreHouseDetailDAL().deleteNode(ID)) // { Jscript.AjaxAlert(this, " 等待操作"); Response.End(); // } // else // { // Jscript.AjaxAlert(this, " 用户已经使用!不能删除!"); //} } } dataBand(); DropDownListBand(); }
/// <summary> /// 上传之后动作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Imageuploader2_Uploaded(object sender, EventArgs e) { string pid = PID.Text.ToString(); string purl = Imageuploader2.PicSavedName; ProductsPhoto p = new ProductsPhoto(); p.ProductsID = int.Parse(pid); p.PhotoUrl = purl; if (Leyp.SQLServerDAL.Factory.getProductsPhotoDAL().insertNewNode(p)) { Imageuploader2.DefaultPreviewImageURL = ""; Jscript.AjaxAlert(this, "上传成功!"); Response.Redirect("Products_Photo_Attach.aspx?action=view&ProductsID=" + PID.Text.ToString(), true); return; } else { Jscript.AjaxAlert(this, "操作失败!"); return; } }
protected void Button1_Click(object sender, EventArgs e) { UserDAL bs = new UserDAL(); string userName = StrHelper.ConvertSql(inputName.Value.ToString()); string userPwd = inputPassword.Value.Trim();//string userPwd = StrHelper.EncryptPassword(PassWord.Text.ToString(), StrHelper.PasswordType.MD5); //if (bs.isLoginValidate(userName, userPwd)) //{ // Leyp.Model.User s = bs.getByUserName(userName); // SessionUser ss = new SessionUser(); // ss.UserName = s.UserName; // ss.TypeID = s.TypeID; // ss.SubClassID = s.SubClassID; // ss.GroupID = s.GroupID; // Leyp.Components.Module.BaseLogin.SetSession(ss);//保存Session // new BasePage().addSystemLog("登錄進入系統"); // Response.Redirect("Index.aspx"); //} //else //{ // Jscript.AjaxAlert(this, "登录失败!请检查用户名和密码"); // return; //} ////驗證碼測試,可用(2019/09/07) //string Code = Session["ValidateNum"].ToString().Trim(); //if (Code == userPwd.ToUpper()) //{ // Response.Redirect("Result.aspx"); //} //else // Response.Write("<script language='javascript'>alert('跳转失败!');</script>"); //return; if (bs.isLoginValid(userName, userPwd)) { int selLangID = selLang.SelectedIndex; string LangID = "0"; if (selLangID > 0)//選擇語言:0-繁體;1-英語;2-簡體 { LangID = (selLangID - 1).ToString(); } Leyp.Model.User s = bs.getUserInfo(userName); SessionUser ss = new SessionUser(); ss.UserName = s.UserName; ss.TypeID = s.TypeID; ss.SubClassID = s.SubClassID; ss.GroupID = s.GroupID; if (selLangID == 0)//如果沒有選擇語言,則用用戶默認的語言 { LangID = s.Lang; if (LangID != "0" && LangID != "1" && LangID != "2")//如果用戶默認的語言也沒有,則用繁體語言 { LangID = "0"; } } ss.Lang = LangID; // s.Lang; Leyp.Components.Module.BaseLogin.SetSession(ss); //保存Session new BasePage().addSystemLog("登錄進入系統"); //Response.Redirect("Index.aspx"); Response.Redirect("MainForm.aspx"); } else { Jscript.AjaxAlert(this, "登录失败!请检查用户名和密码"); return; } //UserDAL bs = new UserDAL(); //string userName = StrHelper.ConvertSql(UserName.Text.ToString()); //string userPwd = StrHelper.EncryptPassword(PassWord.Text.ToString(), StrHelper.PasswordType.MD5); //if (bs.isLoginValidate(userName, userPwd)) //{ // Leyp.Model.User s = bs.getByUserName(userName); // SessionUser ss = new SessionUser(); // ss.UserName = s.UserName; // ss.TypeID = s.TypeID; // ss.SubClassID = s.SubClassID; // ss.GroupID = s.GroupID; // Leyp.Components.Module.BaseLogin.SetSession(ss);//保存Session // new BasePage().addSystemLog("登錄進入系統"); // Response.Redirect("Index.aspx"); //} //else //{ // Jscript.AjaxAlert(this, "登录失败!请检查用户名和密码"); // return; //} }
/// <summary> /// 提交修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Add_Submit_Click(object sender, EventArgs e) { string strName = UserName.Text.ToString(); string strRname = RealName.Text.ToString(); int typeid; int subClass; string strState; int groupid; if (AuthorityBox.Checked)//如果选中要修改权限 { typeid = int.Parse(TypeID.SelectedValue.ToString()); subClass = int.Parse(SubClassID.SelectedValue.ToString()); strState = State.SelectedValue.ToString(); groupid = int.Parse(GroupID1.Value.ToString()); } else { typeid = int.Parse(usertypeLabel1.Text.ToString()); subClass = int.Parse(subclassLabel2.Text.ToString()); groupid = int.Parse(groupLabel3.Text.ToString()); strState = StateLabel4.Text.ToString(); } if (subClass.Equals("-1")) { Jscript.AjaxAlert(this, "请选择用户类型"); return; } string strDept = Dept.Text.ToString(); string strQQ = QQ.Text.ToString(); string strTaobao = WangWang.Text.ToString(); string strTel = Tel.Text.ToString(); string strEmail = Email.Text.ToString(); string strDesc = Description.Text.ToString(); string strSex = Sex.SelectedValue.ToString(); Leyp.Model.User u = new Leyp.Model.User(); u.UserName = strName; u.Description = strDesc; u.Email = strEmail; u.GroupID = groupid; u.TypeID = typeid; u.SubClassID = subClass; u.QQ = strQQ; u.RealName = strRname; u.Sex = strSex; u.State = strState; u.WangWang = strTaobao; u.Tel = strTel; u.Dept = strDept; if (Leyp.SQLServerDAL.Factory.getUserDAL().updateUser(u)) { Panel1.Visible = false; Panel0.Visible = false; Panel2.Visible = false; HyperLink1.Visible = true; } else { Panel1.Visible = false; Panel0.Visible = false; Panel2.Visible = false; HyperLink1.Text = "操作失败!请重操作"; HyperLink1.Visible = true; } }