Sunday, July 12, 2020
Friday, June 26, 2020
Thursday, June 11, 2020
Partial spacific property update in ef or single property or one property or spacific
[HttpPost]
public async Task<ActionResult> update_nominee(custreg_working d, string id)
{
using (var context = new db_context())
{
d.cust_id = id;
context.Configuration.ValidateOnSaveEnabled = false;
context.custreg_working.Attach(d);
System.Data.Entity.Infrastructure.DbEntityEntry<custreg_working> entry = context.Entry(d);
entry.Property(e => e.Nominee).IsModified = true;
entry.Property(e => e.Relation).IsModified = true;
entry.Property(e => e.nmob).IsModified = true;
await context.SaveChangesAsync();
}
return RedirectToAction("edit", new { id = d.cust_id });
}
Monday, June 8, 2020
sql recursion or recursion in sql server or go to
DECLARE @text VARCHAR(50) = NULL;
nn:
if(@text is not null)
begin
EXEC [dbo].[CreateRandomString] @minLength = 10,@maxLength = 10, @randomString = @text OUTPUT;
end
if(@text is null) begin
set @text='Pudzw6p5w'
end
if(select count(*) from product_keypin where pinkey=@text)>0
begin
print 'Duplicate'
goto nn
end else begin
print 'No Duplicate'
end;
Sunday, May 31, 2020
Thursday, May 14, 2020
Delete in Linq or Delete in Linq in Array List or Delete in Linq from Array List or Update in Linq or Update in Linq in Array List or Update in Linq in Object List
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);
}
}
}
}
}
Sunday, April 5, 2020
a href # color or link color or blank link color
using with single cot or double cot
<style>
.dropdown-menu a[href='#'] {
background-color: yellow;
}
</style>
<style>
.dropdown-menu a[href='#'] {
background-color: yellow;
}
</style>
Subscribe to:
Posts (Atom)
Linq Expression syntax for where condtion in linq
(Expression<Func<T, bool>> filter)
-
Page preview on single click VS2015 or further or on single click page open in solution explorer Menu>Tools>Options>Environment...
-
(Expression<Func<T, bool>> filter)