/// <summary> /// 获取获取未出库的账单菜品 /// </summary> /// <param name="filter">指定条件</param> /// <returns>返回第一行</returns> public DataTable ClearUnuseBillByTable(string GUID, string UID, string OpenCode, string StoCode) { SqlParameter[] sqlParameters = { new SqlParameter("@stocode", StoCode), new SqlParameter("@opencode", OpenCode) }; DataTable dtReturn = new bllPaging().GetDataTableInfoByProcedure("p_ClearTableUnuseBill", sqlParameters); return(dtReturn); }
/// <summary> /// 整表更新订单菜品 /// </summary> /// <param name="GUID"></param> /// <param name="UID"></param> /// <param name="StoCode"></param> /// <param name="dtDish"></param> public void UpdateByTable(string GUID, string UID, string Stocode, DataTable dtDish) { StringBuilder sbSql = new StringBuilder(); foreach (DataRow dr in dtDish.Rows) { string discountType = dr["DiscountType"].ToString(); string discountmoney = dr["DiscountPrice"].ToString(); string pkcode = dr["orderdiscode"].ToString(); string totalmoney = ((StringHelper.StringToDecimal(dr["disnum"].ToString())) * StringHelper.StringToDecimal(dr["DiscountPrice"].ToString())).ToString("f2"); string tempSql = string.Format("Update TB_OrderDish set DiscountType='{0}',DiscountPrice={1},TotalMoney='{4}' where PKCode='{2}' and Stocode='{3}';", discountType, discountmoney, pkcode, Stocode, totalmoney); sbSql.AppendLine(tempSql); } int rel = new bllPaging().ExecuteNonQueryBySQL(sbSql.ToString()); }
public string UpdateBillAndDish(DataTable dtBill, DataTable dtDish) { string rel = ""; string billcode = dtBill.Rows[0]["PKCode"].ToString(); string stocode = dtBill.Rows[0]["stocode"].ToString(); string zerocutmoney = dtBill.Rows[0]["zerocutmoney"].ToString(); string discountname = ""; string paymethod = dtBill.Rows[0]["PayMethod"].ToString(); //dtBill.Rows[0]["discountname"].ToString(); string discountmoney = dtBill.Rows[0]["discountmoney"].ToString(); string paymoney = dtBill.Rows[0]["paymoney"].ToString(); string billSql = string.Format("update tb_bill set PayMethod='{6}',zerocutmoney={0},discountname='{1}',discountmoney={2},paymoney={3} where PKCode='{4}' and StoCode='{5}' ;", zerocutmoney, discountname, discountmoney, paymoney, billcode, stocode, paymethod ); StringBuilder sbDisSql = new StringBuilder(); sbDisSql.AppendLine(billSql); foreach (DataRow dr in dtDish.Rows) { string discounttype = dr["discounttype"].ToString(); discountmoney = dr["discountprice"].ToString(); string pkcode = dr["orderdiscode"].ToString(); string discountremark = dr["discountremark"].ToString(); string sqlTemp = string.Format("update tb_orderdish set discountprice={0},discounttype='{1}',discountremark='{4}' where PKCode='{2}' and Stocode='{3}';", discountmoney, discounttype, pkcode, stocode, discountremark ); sbDisSql.AppendLine(sqlTemp); } sbDisSql.AppendLine(string.Format("execute [dbo].[p_TB_Bill_UpStatuByMoney] '{0}','{1}';", stocode, billcode)); string sql = sbDisSql.ToString(); int rn = new bllPaging().ExecuteNonQueryBySQL(sql); if (rn < 0) { rel = "error"; } return(rel); }
/// <summary> /// 获取用户的角色 /// </summary> /// <param name="GUID"></param> /// <param name="USER_ID"></param> /// <param name="userid"></param> /// <param name="pagecode"></param> /// <returns></returns> public DataTable GetUserRole(string GUID, string UID, string userid, string pagecode) { DataTable dt = new DataTable(); string sql = "SELECT * FROM dbo.sto_functions WHERE ftype=1 and status='1' and id in(select funid from sto_rolefunction where roleid in(SELECT roleid FROM dbo.sto_userrole WHERE userid='" + userid + "')) order by orders asc"; dt = new bllPaging().GetDataTableInfoBySQL(sql); DataTable butdt = dt.Clone(); if (dt != null && dt.Rows.Count > 0) { //获取一级菜单 DataRow[] drs = dt.Select(" code='" + pagecode + "'"); if (drs.Length > 0) { for (int i = 0; i < drs.Length; i++) { DataRow dr = butdt.NewRow(); dr.ItemArray = drs[i].ItemArray; butdt.Rows.Add(dr); } } } return(butdt); }
public DataSet GetDetail(string roleid) { DataSet ds = new bllPaging().GetDataSetInfoBySQL("select *,storename=dbo.fnGetMuStoreName(stocode),[dbo].[fnGetBusinessNameByCode](buscode) as BusName from roles where roleid='" + roleid + "';select B.id,parentid as pId,cname as name,'true'as 'open',ishave=(case when funid>0 then 1 else 0 end) from functions B left join (select funid from rolefunction where roleid='" + roleid + "') A on A.funid=B.id where B.status='1';"); return(ds); }