/// <summary> /// Delete record from tblAcntLink /// </summary> /// <param name="intAcntLinkIdno"></param> /// <returns></returns> public int Delete(int Igrpidno) { int intValue = 0; try { using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString())) { tblAcntLink objAcntLink = (from mast in db.tblAcntLinks where mast.AcntLink_Idno == Igrpidno select mast).FirstOrDefault(); if (objAcntLink != null) { db.tblAcntLinks.DeleteObject(objAcntLink); db.SaveChanges(); intValue = 1; } } } catch (Exception Ex) { if (Convert.ToBoolean(Ex.InnerException.Message.Contains("The DELETE statement conflicted with the REFERENCE constraint")) == true) { intValue = -1; } } return(intValue); }
public tblAcntLink SelectAcntLink() { using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString())) { tblAcntLink AcntLink = (from UP in db.tblAcntLinks select UP).FirstOrDefault(); return(AcntLink); } }
public tblAcntLink GetAccountLinkData() { using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString())) { tblAcntLink objAcntLink = new tblAcntLink(); objAcntLink = (from obj in db.tblAcntLinks // where obj.IGrp_Idno == intIGrpIdno select obj).FirstOrDefault(); return(objAcntLink); } }
// public Int64 InsertAccount(string strAcntHead, Int64 intAcntLinkidno, Int64 intCompId) // { // Int64 intValue = 0; //// Int32 intCompIdno = 1; // try // { // using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString())) // { // tblAcntLink objAcntLink = new tblAcntLink(); // objAcntLink. = Cmmn; // objAcntLink.OthrAc_Idno = OthrAmnt; // objAcntLink.Igrp_Idno = GrpTyp; // objAcntLink.Comp_Idno = intCompIdno; // objAcntLink.Date_Added = System.DateTime.Now; // { // db.tblAcntLinks.AddObject(objAcntLink); // db.SaveChanges(); // intValue = objAcntLink.AcntLink_Idno; // } // } // } // catch (Exception ex) // { // //ApplicationFunction.ErrorLog(ex.ToString()); // } // return intValue; // } /// <summary> /// Update records in tblAcntLink /// </summary> /// <param name="strUOMName"></param> /// <param name="strUOMDesc"></param> /// <param name="bStatus"></param> /// <param name="intAcntLinkIdno"></param> /// <returns></returns> public Int64 Update(Int64 Cmmn, Int64 OthrAmnt, Int64 GrpTyp, Int64 intSTAcntIdno, Int64 IntTdsAcntIdno, Int64 intDebitIdno, Int64 intTDSAmnt, Int32 empIdno, Int64 intSwachhBha, Int64 intKrishiKalyan, Int64 intDiesel, Int64 intSGST, Int64 intCGST, Int64 intIGST) { Int64 intValue = 0; Int32 intCompIdno = 1; try { using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString())) { tblAcntLink objAcntLink = (from mast in db.tblAcntLinks where mast.Igrp_Idno == GrpTyp select mast).FirstOrDefault(); if (objAcntLink != null) { objAcntLink.Commsn_Idno = Cmmn; objAcntLink.SAcnt_Idno = intSTAcntIdno; objAcntLink.OthrAc_Idno = OthrAmnt; objAcntLink.Emp_Idno = empIdno; objAcntLink.TDS_Idno = IntTdsAcntIdno; objAcntLink.Igrp_Idno = GrpTyp; objAcntLink.Comp_Idno = intCompIdno; objAcntLink.Date_modified = System.DateTime.Now; objAcntLink.Debit_Idno = intDebitIdno; objAcntLink.TDSAmnt_Idno = intTDSAmnt; objAcntLink.SwachBharat_Idno = intSwachhBha; objAcntLink.KrishiKalyan_Idno = intKrishiKalyan; objAcntLink.DieselAcc_Idno = intDiesel; objAcntLink.Sgst_Idno = intSGST; objAcntLink.Cgst_Idno = intCGST; objAcntLink.Igst_Idno = intIGST; { db.SaveChanges(); intValue = objAcntLink.AcntLink_Idno; } } } } catch (Exception ex) { //ApplicationFunction.ErrorLog(ex.ToString()); } return(intValue); }
public bool IsExists(Int32 igrpidno) { using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString())) { tblAcntLink objAcntLink = new tblAcntLink(); if (igrpidno > 0) { objAcntLink = (from mast in db.tblAcntLinks where mast.Igrp_Idno == igrpidno select mast).FirstOrDefault(); } if (objAcntLink != null) { return(true); } else { return(false); } } }
public Int32 UpdateStatus(int Igrpidno) { int value = 0; try { using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString())) { tblAcntLink objAcntLink = (from mast in db.tblAcntLinks where mast.AcntLink_Idno == Igrpidno select mast).FirstOrDefault(); if (objAcntLink != null) { objAcntLink.Date_modified = System.DateTime.Now; db.SaveChanges(); value = 1; } } } catch (Exception ex) { } return(value); }