/// <summary> /// 修改家政公司 /// </summary> /// <returns></returns> public bool MakUpdate(HomeMakInfo makinfo) { SqlParameter[] count = { new SqlParameter("@nID", makinfo.nID), new SqlParameter("@HomeCode", makinfo.HomeCode), new SqlParameter("@HomeName", makinfo.HomeName), new SqlParameter("@HomePass", makinfo.HomePass), new SqlParameter("@tRealName", makinfo.tRealName), new SqlParameter("@HomeMobile", makinfo.HomeMobile), new SqlParameter("@HomePhone", makinfo.HomePhone), new SqlParameter("@HomeEmail", makinfo.HomeEmail), new SqlParameter("@HomeCity", makinfo.HomeCity), new SqlParameter("@HomePro", makinfo.HomePro), new SqlParameter("@HomeIntro", makinfo.HomeIntro), new SqlParameter("@oCheck", makinfo.oCheck), new SqlParameter("@tPic", makinfo.TPic), new SqlParameter("@Lng", makinfo.Lng), new SqlParameter("@Lat", makinfo.Lat), new SqlParameter("@tMemo", makinfo.TMemo), new SqlParameter("@HomeIntegral", makinfo.HomeIntegral), new SqlParameter("@cid", makinfo.cid), new SqlParameter("@nLogNum", makinfo.nLogNum), new SqlParameter("@CreatorCode", makinfo.CreatorCode), }; string sql = string.Format(@"update ML_HomeMaking set HomeCode=@HomeCode,HomeName=@HomeName,HomePass=@HomePass,tRealName=@tRealName,HomeMobile=@HomeMobile,HomePhone=@HomePhone,HomeEmail=@HomeEmail,HomeCity=@HomeCity,HomePro=@HomePro,HomeIntro=@HomeIntro,oCheck=@oCheck,tPic=@tPic,Lng=@Lng,Lat=@Lat,tMemo=@tMemo,HomeIntegral=@HomeIntegral,cid=@cid,nLogNum=@nLogNum,CreatorCode=@CreatorCode where nID=@nID"); bool success = false; try { success = her.ExecuteNonQuery(sql, count); } catch { } return(success); }
protected void gridField_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "jinyong") { HomeMakInfo makinfo = new HomeMakInfo(); makinfo.nID = int.Parse(e.CommandArgument.ToString()); makinfo.oCheck = "0"; bool success = makbll.MakUpd(makinfo); if (success) { GridBind(); Pagination2.Refresh(); } } if (e.CommandName == "qiyong") { HomeMakInfo makinfo = new HomeMakInfo(); makinfo.nID = int.Parse(e.CommandArgument.ToString()); makinfo.oCheck = "1"; bool success = makbll.MakUpd(makinfo); if (success) { GridBind(); Pagination2.Refresh(); } } if (e.CommandName == "update") { Response.Redirect("HomeMakEdit.aspx?id=" + e.CommandArgument.ToString() + "&&ceid=" + gridField.PageIndex); } if (e.CommandName == "dingdan") { Response.Redirect("../Order/OrderMainDL.aspx?dlid=" + e.CommandArgument.ToString()); } if (e.CommandName == "detail") { Response.Redirect("HomeMakByOne.aspx?id=" + e.CommandArgument.ToString()); } if (e.CommandName == "AddUrl") { var url = makeUrl(e.CommandArgument.ToString()); var picName = ImageAdd(url); HomeMakInfo makinfo = new HomeMakInfo(); makinfo.nID = int.Parse(e.CommandArgument.ToString()); makinfo.HomePic = picName; makinfo.CreatorName = url; if (makbll.MakUrl(makinfo)) { GridBind(); Pagination2.Refresh(); } else { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('生成失败')</script>"); } } }
/// <summary> /// 删除账号 /// </summary> /// <returns></returns> public bool MakDel(HomeMakInfo makinfo) { SqlParameter[] count = { new SqlParameter("@nID", makinfo.nID) }; string sql = string.Format(@"delete from ML_HomeMaking where nID=@nID"); bool success = false; try { success = her.ExecuteNonQuery(sql, count); } catch { } return(success); }
/// <summary> /// 禁用账号 /// </summary> /// <returns></returns> public bool MakUpd(HomeMakInfo makinfo) { SqlParameter[] count = { new SqlParameter("@nID", makinfo.nID), new SqlParameter("@oCheck", makinfo.oCheck) }; string sql = string.Format(@"update ML_HomeMaking set oCheck=@oCheck where nID=@nID"); bool success = false; try { success = her.ExecuteNonQuery(sql, count); } catch { } return(success); }
/// <summary> /// 生成商城地址 /// </summary> /// <returns></returns> public bool MakUrl(HomeMakInfo makinfo) { SqlParameter[] count = { new SqlParameter("@nID", makinfo.nID), new SqlParameter("@HomePic", makinfo.HomePic), new SqlParameter("@CreatorName", makinfo.CreatorName) }; string sql = string.Format(@"update ML_HomeMaking set HomePic=@HomePic,CreatorName=@CreatorName where nID=@nID"); bool success = false; try { success = her.ExecuteNonQuery(sql, count); } catch { } return(success); }
protected void imgdelete_Click(object sender, EventArgs e) { for (int i = 0; i < gridField.Rows.Count; i++) { CheckBox ckb = (CheckBox)gridField.Rows[i].FindControl("CheckSel"); if (ckb.Checked) { HomeMakInfo makinfo = new HomeMakInfo(); makinfo.nID = int.Parse(gridField.DataKeys[i].Value.ToString()); makinfo.oCheck = "0"; bool success = makbll.MakUpd(makinfo); if (!success) { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('发生未知错误!请重试')</script>"); } } } GridBind(); Pagination2.Refresh(); }
/// <summary> /// 添加家政公司 /// </summary> /// <returns></returns> public bool MakInsert(HomeMakInfo makinfo) { SqlParameter[] count = { new SqlParameter("@HomeCode", makinfo.HomeCode), new SqlParameter("@HomeName", makinfo.HomeName), //账号 new SqlParameter("@HomePass", makinfo.HomePass), //密码 new SqlParameter("@cid", makinfo.cid), //代理级别 new SqlParameter("@tRealName", makinfo.tRealName), new SqlParameter("@HomeMobile", makinfo.HomeMobile), new SqlParameter("@HomeMobileYz", makinfo.HomeMobileYz), new SqlParameter("@HomePhone", makinfo.HomePhone), new SqlParameter("@HomeEmail", makinfo.HomeEmail), new SqlParameter("@HomeCity", makinfo.HomeCity), new SqlParameter("@HomePro", makinfo.HomePro), new SqlParameter("@HomeIntro", makinfo.HomeIntro), new SqlParameter("@HomeIntegral", makinfo.HomeIntegral), new SqlParameter("@HomePic", makinfo.HomePic), new SqlParameter("@CreatorName", makinfo.CreatorName), new SqlParameter("@CreatorCode", makinfo.CreatorCode), new SqlParameter("@nLogNum", makinfo.nLogNum), new SqlParameter("@dtLastTime", makinfo.dtLastTime), new SqlParameter("@dtAddTime", makinfo.dtAddTime), new SqlParameter("@tLastIP", makinfo.tLastIP), new SqlParameter("@oCheck", makinfo.oCheck), new SqlParameter("@oHide", makinfo.oHide), new SqlParameter("@tPic", makinfo.TPic), new SqlParameter("@Lng", makinfo.Lng), new SqlParameter("@Lat", makinfo.Lat), new SqlParameter("@tMemo", makinfo.TMemo), new SqlParameter("@MoneyAll", makinfo.MoneyAll), }; string sql = string.Format(@"insert into ML_HomeMaking values (@HomeCode, @HomeName, @HomePass, @cid, @tRealName, @HomeMobile, @HomeMobileYz, @HomePhone,@HomeEmail, @HomePic, @HomePro, @HomeCity, @HomeIntro, @HomeIntegral, @CreatorName, @CreatorCode, @nLogNum, @dtLastTime, @dtAddTime, @tLastIP, @oCheck, @oHide,@tPic,@Lng,@Lat,@tMemo,@MoneyAll)"); bool success = false; try { success = her.ExecuteNonQuery(sql, count); } catch { } return(success); }
public void updatemak(string id) { //if (hideLng.Value == "" || hideLat.Value == "") //{ // ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('未获取位置信息')</script>"); // return; //} if (hid2.Value != txtName.Value.Trim()) { bool cuss = makbll.SelMakName(" where HomeName='" + txtName.Value.Trim() + "'"); if (cuss) { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('登录名已存在')</script>"); return; } } if (FileUpload1.HasFile) { UploadPhoto(); DeletePhoto(hid.Value); } HomeMakInfo homemak = new HomeMakInfo(); homemak.nID = int.Parse(id); homemak.TPic = hid3.Value; homemak.TMemo = content1.InnerText; homemak.Lng = Convert.ToDecimal(hideLng.Value == "" ? "0" : hideLng.Value); homemak.Lat = Convert.ToDecimal(hideLat.Value == "" ? "0" : hideLat.Value); homemak.HomePro = dropSheng.SelectedItem.Text == "请选择" ? "" : dropSheng.SelectedItem.Text; homemak.HomeCity = dropShi.SelectedItem.Text == "请选择" ? "" : dropShi.SelectedItem.Text; homemak.HomeCode = txtCode.Value.Trim(); homemak.HomeName = txtName.Value.Trim(); if (hid1.Value == txtPass.Text.Trim()) { homemak.HomePass = txtPass.Text.Trim(); } else { homemak.HomePass = txtPass.Text.Trim(); } homemak.tRealName = txtCompany.Value.Trim(); homemak.HomePhone = txtPhone.Value.Trim(); homemak.HomeMobile = txtMebile.Value.Trim(); homemak.HomeEmail = txtEmail.Value.Trim(); homemak.HomeIntro = txtAddress.Value.Trim(); if (ckb.Checked) { homemak.oCheck = "1"; } else { homemak.oCheck = "0"; } homemak.HomeIntegral = txtlxr.Value.Trim(); //联系人; homemak.cid = "3"; //代理等级 homemak.nLogNum = 1; //上级代理id homemak.CreatorCode = txtYouBian.Value.Trim(); //youbian bool success = makbll.MakUpdate(homemak); if (success) { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('修改完成')</script>"); //Response.Redirect("HomeMakMain.aspx?ceid=" + Request.QueryString["ceid"].ToString()); } }
public void Addmak() { //if (hideLng.Value == "" || hideLat.Value == "") //{ // ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('未获取位置信息')</script>"); // return; //} bool cuss = makbll.SelMakName(" where HomeName='" + txtName.Value.Trim() + "'"); if (cuss) { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('登录名已存在')</script>"); return; } if (FileUpload1.HasFile) { UploadPhoto();//图片不是必填 } HomeMakInfo homemak = new HomeMakInfo(); homemak.HomePro = dropSheng.SelectedItem.Text == "请选择" ? "" : dropSheng.SelectedItem.Text; homemak.HomeCity = dropShi.SelectedItem.Text == "请选择" ? "" : dropShi.SelectedItem.Text; homemak.HomeCode = txtCode.Value.Trim(); homemak.CreatorCode = txtYouBian.Value.Trim();//youbian homemak.TPic = hid3.Value; homemak.TMemo = content1.InnerText; homemak.Lng = Convert.ToDecimal(hideLng.Value == "" ? "0" : hideLng.Value); homemak.Lat = Convert.ToDecimal(hideLat.Value == "" ? "0" : hideLat.Value); homemak.HomeName = txtName.Value.Trim(); homemak.HomePass = txtPass.Text.Trim(); homemak.tRealName = txtCompany.Value.Trim(); homemak.HomePhone = txtPhone.Value.Trim(); homemak.HomeMobile = txtMebile.Value.Trim(); homemak.HomeMobileYz = "0"; homemak.HomeEmail = txtEmail.Value.Trim(); homemak.HomePic = ""; homemak.HomeIntro = txtAddress.Value.Trim(); homemak.HomeIntegral = txtlxr.Value.Trim();//联系人; homemak.CreatorName = ""; //homemak.CreatorCode = ""; homemak.nLogNum = Convert.ToInt32(dropFatherDaili.SelectedItem.Value); //上级代理id if (ckb.Checked) { homemak.oCheck = "1"; } else { homemak.oCheck = "0"; } homemak.oHide = "1"; // 不是总部 homemak.tLastIP = ""; homemak.cid = dropDailiSystem.SelectedItem.Value; //代理等级 homemak.dtAddTime = DateTime.Now.ToString(); homemak.dtLastTime = DateTime.Now.ToString(); // homemak.TPic= bool success = makbll.MakInsert(homemak); if (success) { ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('添加完成')</script>"); Initialization(); } }