var stc_list = (from x in stc_list_
join y in sz on new { x.ICode, x.Clr_Code, x.SzCode } equals new { y.ICode, y.Clr_Code, y.SzCode }
orderby x.SzSort
select (new v_stock_clr_sz { ICode = x.ICode, Clr_Code = x.Clr_Code, SzCode = x.SzCode, SzQty_Pur = x.SzQty_Pur, SzQty_Sale = y.SzQty, SzQty_SaleR = x.SzQty_SaleR, SzQty_PurR = x.SzQty_PurR, SzQty_StoE = x.SzQty_StoE, SzQty_Srap = x.SzQty_Srap, stock = x.stock, SzName = x.SzName, SzSort = x.SzSort, Clr_Name = x.Clr_Name, mIcode = x.mIcode, UDI_Bar = x.UDI_Bar, Item_ID = x.Item_ID, IName = x.IName, Product_Name = x.Product_Name, Product_Name_Oth = x.Product_Name_Oth, path = x.path, photo = x.photo, photo_oth = x.photo_oth, GCode = x.GCode, SzCodeG = x.SzCodeG, GName = x.GName, SzNameG = x.SzNameG, Br_Code = x.Br_Code, Br_Name = x.Br_Name, St_Code = x.St_Code, St_Name = x.St_Name, Om_Code = x.Om_Code, Om_Name = x.Om_Name, Sg_Code = x.Sg_Code, Sg_Name = x.Sg_Name, Im_Code = x.Im_Code, Im_Name = x.Im_Name, TAX = x.TAX, Detail = x.Detail, Unit = x.Unit, Tax_Code = x.Tax_Code, HSN = x.HSN, Pur_Rate = x.Pur_Rate, Sale_Rate = x.Sale_Rate, MRP = x.MRP, Edate = x.Edate, E_ID = x.E_ID, Udate = x.Udate, U_ID = x.U_ID, U_Remark = x.U_Remark })).ToList();
foreach (var item in stc_list)
{
if (get_avaiable == false)
{
if (((du.Valc(item.stock) - du.Valc(item.SzQty_Sale)) < 0))
{
msg = db.msg_stock_not;
return (st: false, msg: msg, order_Det_List);
}
}
else
{
if (du.Valc(item.SzQty_Sale) < 1 || du.Valc(item.stock) < 1)
{
sz.RemoveAll(x => x.ICode == item.ICode && x.Clr_Code == item.Clr_Code && x.SzCode == item.SzCode);
}
else
{
if ((du.Valc(item.stock) - du.Valc(item.SzQty_Sale)) < 0)
{
var udata = from x in sz
where x.ICode == item.ICode && x.Clr_Code == item.Clr_Code && x.SzCode == item.SzCode
select x;
foreach (var dd in udata)
{
dd.SzQty = du.Valc(item.stock);
}
}
}
}
}
No comments:
Post a Comment