public bool Delete() { string sql = string.Format("Delete from StoreCustomerMeg where id={0} ", Id); return(m_dbo.ExecuteNonQuery(sql)); }
public bool Delete() { string sql = string.Format("Delete from TPI_OperationLog where id={0} ", Id); return(m_dbo.ExecuteNonQuery(sql)); }
public bool Delete(int GoodsId, string type) { string sql = string.Format("Delete from GoodsPackage where goodsId={0} and Type='{1}' ", GoodsId, type); return(m_dbo.ExecuteNonQuery(sql)); }
public bool Delete() { string sql = string.Format("Delete from GoodsPackageLog where id={0} ", Id); return(m_dbo.ExecuteNonQuery(sql)); }
/// <summary> /// 修改订单明细状态 /// </summary> /// <param name="Id"></param> /// <param name="OrderId"></param> /// <returns></returns> public bool UpdatePurchaseType(string Id) { string sql = string.Format("Update OrderModify set PurchaseType='已完成' where Id in({0})", Id); return(m_dbo.ExecuteNonQuery(sql)); }
public bool Delete() { string sql = string.Format("Delete from Sys_Users where id={0} ", Id); return(m_dbo.ExecuteNonQuery(sql)); }
public bool Delete() { string sql = string.Format("Delete from PointDetail where id={0} ", Id); return(m_dbo.ExecuteNonQuery(sql)); }
/// <summary> /// 增加打印次数 /// </summary> /// <returns></returns> public bool AddPrintNum() { string sql = string.Format("update NeedToPurchase set PrintNum=PrintNum+1 where id={0}", m_Id); return(m_dbo.ExecuteNonQuery(sql)); }
public bool Delete() { string sql = string.Format(" Delete from InvoiceRequire where Id={0} ", m_Id); return(m_dbo.ExecuteNonQuery(sql)); }
public int Save() { m_name = m_name.Replace("(", "(").Replace(")", ")");//将公司名称中的 半角括号 替换成 全角括号 if (m_Id == 0) { //读取公司名称,如果已经存在 就返回 Id if (this.LoadByName(m_name)) { return(this.Id); } } ArrayList arrayList = new ArrayList(); if (m_Id > 0) { arrayList.Add(new SqlParameter("@Id", m_Id)); } arrayList.Add(new SqlParameter("@name", m_name)); arrayList.Add(new SqlParameter("@ShortName", m_ShortName)); arrayList.Add(new SqlParameter("@HasSub", m_HasSub)); arrayList.Add(new SqlParameter("@ParentId", m_ParentId)); arrayList.Add(new SqlParameter("@TypeId", m_TypeId)); arrayList.Add(new SqlParameter("@Status", m_Status)); arrayList.Add(new SqlParameter("@EmployeesNum", m_EmployeesNum)); arrayList.Add(new SqlParameter("@Province", m_Province)); arrayList.Add(new SqlParameter("@City", m_City)); arrayList.Add(new SqlParameter("@Area", m_Area)); arrayList.Add(new SqlParameter("@Street", m_Street)); arrayList.Add(new SqlParameter("@Mansion", m_Mansion)); arrayList.Add(new SqlParameter("@Room", m_Room)); arrayList.Add(new SqlParameter("@Address", GetAddress()));//自动生成的地址格式 arrayList.Add(new SqlParameter("@PostCode", m_PostCode)); arrayList.Add(new SqlParameter("@AddTime", m_AddTime)); arrayList.Add(new SqlParameter("@UpdateTime", m_UpdateTime)); arrayList.Add(new SqlParameter("@InnerUserId", m_InnerUserId)); arrayList.Add(new SqlParameter("@Telphone", m_Telphone)); arrayList.Add(new SqlParameter("@Fax", m_Fax)); arrayList.Add(new SqlParameter("@WebSite", m_WebSite)); arrayList.Add(new SqlParameter("@RegisterMethod", m_RegisterMethod)); arrayList.Add(new SqlParameter("@PY", CommenClass.StringTools.GetFirstPYLetter("(" + m_ShortName + ")" + m_name))); //生成compath string compath = ""; arrayList.Add(new SqlParameter("@Compath", compath)); if (this.Id > 0) { m_dbo.UpdateData("Company", (SqlParameter[])arrayList.ToArray(typeof(SqlParameter))); } else { this.Id = m_dbo.InsertData("Company", (SqlParameter[])arrayList.ToArray(typeof(SqlParameter))); //添加默认的 customer Customer customer = new Customer(); customer.ComId = this.Id; customer.ModelId = 2; customer.Save(); //如果 parentId >0 ,修改parent HasSub =1 if (this.Id > 0) { string sql = string.Format("update company set HasSub =1 where Id={0} ", this.ParentId); m_dbo.ExecuteNonQuery(sql); } } ///修改公司路径 if (this.Id > 0) { string companypath = ""; if (this.ParentId > 0) { Company com = new Company(); com.Id = this.ParentId; com.Load(); companypath = com.ComPath + this.Id.ToString() + "-"; } else { companypath = this.Id.ToString() + "-"; } UpdateComPath(companypath); } return(this.Id); }
public bool Delete() { string sql = string.Format("Delete from Crm_Complain where id={0} ", Id); return(m_dbo.ExecuteNonQuery(sql)); }
public bool Delete() { string sql = string.Format("Delete from VIPApplyModify where id={0} ", Id); return(m_dbo.ExecuteNonQuery(sql)); }
public bool Delete() { string sql = string.Format("Delete from VIPCounterRate where id={0} ", Id); return(m_dbo.ExecuteNonQuery(sql)); }
/// <summary> /// 直接修改商城售价 /// </summary> /// <param name="goodsId"></param> /// <param name="projectId"></param> /// <param name="newPrice"></param> /// <returns></returns> public bool ModifyPrice(int goodsId, string Sku, int projectId, double newPrice) { string sql = string.Format("update TPI_Goods set AgreementPrice ={0},sku='{1}' where ProjectId ={2} and GoodsId ={3} ", newPrice, Sku, projectId, goodsId); return(m_dbo.ExecuteNonQuery(sql)); }
public bool Delete() { string sql = string.Format("Delete from ExportRecord where id={0} ", Id); return(m_dbo.ExecuteNonQuery(sql)); }
public bool RemoveAuthority(int roleId) { string sql = string.Format(" delete from sys_RoleAuthority where RoleId={0} ", roleId); return(m_dbo.ExecuteNonQuery(sql)); }
/// <summary> /// 商品汇总单拆分采购单 /// </summary> /// <param name="NeedToPurchaseId"></param> /// <param name="branchId"></param> /// <param name="StoreId"></param> /// <returns></returns> public bool PurchaseSave(int NeedToPurchaseId, int branchId, int StoreId) { DataTable dtNeedToPurchaseDetail = ReadNeedToPurchaseDetail(NeedToPurchaseId).Tables[0]; if (dtNeedToPurchaseDetail.Rows.Count > 0) { int SId = 0; double taxRate = 0; int isTax = 0; string invoiceType = ""; int SupplierId = 0; foreach (DataRow dr in dtNeedToPurchaseDetail.Rows) { SupplierId = DBTool.GetIntFromRow(dr, "SupplierId", 0); taxRate = DBTool.GetDoubleFromRow(dr, "SprTaxRate", 0.17); invoiceType = DBTool.GetStringFromRow(dr, "SprInvoiceType", ""); switch (invoiceType) { case "无发票": isTax = 0; taxRate = 0; break; case "增票": isTax = 1; break; case "普票": isTax = 2; break; default: isTax = 1; taxRate = 0.17; break; } int UserId = DBTool.GetIntFromRow(dr, "UserId", 0); string PurchaseType = DBTool.GetStringFromRow(dr, "PurchaseType", ""); Purchase p = new Purchase(); p.BranchId = branchId; p.NeedToPurchaseId = NeedToPurchaseId; p.PurchaseStatus = CommenClass.PurchaseStatus.未处理.ToString(); p.PurchaseType = PurchaseType; p.UserId = 0; p.StoreId = StoreId; p.SupplierId = SupplierId; p.PurchaseUserId = UserId; p.IsTax = isTax; p.TaxRate = taxRate; int purchaseId = p.Save(); if (purchaseId > 0) { string sql = string.Format(@"insert into PurchaseDetail(PurchaseId,GoodsId,StoreId,Model,BillsPrice,InPrice,Num,Amount,ReceivedNum,OldStore,OldAC,Emergency,TaxInPrice) select {0}, GoodsId, {1}, '', InPrice, (case when {7}=0 then InPrice*1.25 when {7}=1 then InPrice/(1+{6}) when {7}=2 then InPrice end), -LackNum, (InPrice * (-LackNum)), 0, {1}, InPrice, Emergency, (case when {7}=0 then InPrice*1.25*1.17 when {7}=1 then InPrice when {7}=2 then InPrice*(1+{6}) end) from NeedToPurchaseDetail where NeedToPurchaseId={2} and SupplierId={3} and UserId={4} and LackNum<0; update Purchase set SumMoney=(select ISNULL(SUM(Amount),0) from PurchaseDetail where PurchaseId={0}), Tax=(select ISNULL(SUM(Amount),0) from PurchaseDetail where PurchaseId={0})/(1+{6})*{6} where Id={0}", purchaseId, StoreId, NeedToPurchaseId, SupplierId, UserId, PurchaseType, taxRate, isTax); m_dbo.ExecuteNonQuery(sql); SId = SupplierId; } } NeedToPurchase ntp = new NeedToPurchase(); ntp.AddStatus(NeedToPurchaseId); return(true); } return(false); }