public static Result DB2131108(DbConnections pDB) { Result res = new Result(); DbConnection con = null; try { con = pDB.BeginTransaction("core", "Start"); #region [ INSERT ] string sql = @"insert into pledgemain_Hist select * from pledgemain where status=1"; res = pDB.ExecuteQuery("core", sql, enumCommandType.INSERT, "DB2131108", null); if (res.ResultNo != 0) { return(res); } sql = @"insert into pledgedoc_Hist select * from pledgedoc where status=1"; res = pDB.ExecuteQuery("core", sql, enumCommandType.INSERT, "DB2131108", null); if (res.ResultNo != 0) { return(res); } #endregion #region [ DELETE ] sql = @"delete from pledgemain where status=1"; res = pDB.ExecuteQuery("core", sql, enumCommandType.DELETE, "DB2131108", null); if (res.ResultNo != 0) { return(res); } sql = @"delete from pledgedoc where status=1"; res = pDB.ExecuteQuery("core", sql, enumCommandType.DELETE, "DB2131108", null); return(res); #endregion } catch (Exception ex) { res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } finally { if (res.ResultNo == 0) { con.Commit(); } else { con.Rollback(); } } return(res); }
public Result Txn130501(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = new Result(); try { string sql = @"select a.prodno,b.name from prodtimesheet a left join servmain b on b.servid=a.prodno where orderno=:1 and prodno<>:2"; res = db.ExecuteQuery("core", sql, enumCommandType.SELECT, "Txn130501", ri.ReceivedParam[0], ri.ReceivedParam[1]); return(res); } catch (Exception ex) { res.ResultNo = 9110002; res.ResultDesc = "Програм руу нэвтрэхэд алдаа гарлаа" + ex.Message; EServ.Shared.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); return(res); } finally { lg.item.Desc = "Захиалгын хуваарьт орсон үйлчилгээнүүдийн жагссалт авах"; } }
private Result GetTodayCustomer(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = new Result(); string sql = ""; try { //-- Өнөөдөр нийт хэдэн харилцагч гүйлгээ хийсэнийг олж авах sql = @" SELECT CustNo FROM glfile WHERE Txndate = :1 GROUP BY CustNo"; res = db.ExecuteQuery("core", sql, enumCommandType.SELECT, "GetTodayCustomer", Static.ToDate(ri.ReceivedParam[0])); return(res); } catch (Exception ex) { res.ResultNo = 9110002; res.ResultDesc = "Програм руу нэвтрэхэд алдаа гарлаа" + ex.Message; ISM.Lib.Static.WriteToLogFile("ProcessError.log", ex.Message + ex.Source + ex.StackTrace); return(res); } return(res); }
} //Захиалгад хамрагдсан үйлчлүүлэгчид public Result Txn603003(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = null; try { #region Prepare parameters string orderno = Static.ToStr(ri.ReceivedParam[0]); #endregion #region Prepare query string sql = @"select orderno,groupno,prodno,prodtype,qty from orderproduct where orderno=:1"; #endregion #region Execute query object[] param = new object[] { orderno }; res = db.ExecuteQuery("core", sql, enumCommandType.SELECT, "Txn603003", param); #endregion } catch (Exception ex) { res = new Result(9110002, "Програм руу нэвтрэхэд алдаа гарлаа" + ex.Message); } return(res); } //Захиалгад хамрагдсан бараанууд
object[] ProcessPLSQL(DbConnections db, long pkey, string PLSQLName) { object[] obj = new object[3]; try { OracleCommand cmd = new OracleCommand(); cmd.CommandText = PLSQLName; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("pID", OracleDbType.Decimal, ParameterDirection.Input); cmd.Parameters.Add("rebateID", OracleDbType.Decimal, ParameterDirection.Output); cmd.Parameters.Add("loyalID", OracleDbType.Decimal, ParameterDirection.Output); cmd.Parameters.Add("pointID", OracleDbType.Decimal, ParameterDirection.Output); cmd.Parameters["pID"].Value = pkey; Result res = db.ExecuteQuery("core", cmd, enumCommandType.SELECT, "Txn50000x"); if (res.ResultNo != 0) { return(obj); } obj[0] = cmd.Parameters["rebateID"].Value; obj[1] = cmd.Parameters["loyalID"].Value; obj[2] = cmd.Parameters["pointID"].Value; } catch (Exception ex) { obj = null; return(obj); } return(obj); }
public static Result DB216001(DbConnections pDB) { Result res = new Result(); try { string sql; sql = @"SELECT MASKTYPE, MASKVALUE, MASKDESCRIPTION, DEFAULTPASS, CREATETYPE, VALIDDAY, WRONGCOUNT, HISTORYCOUNT, servername, serverport, mailusername, mailuserpass, fromuser, isSendMail FROM PASSPOLICY WHERE ID=1"; res = pDB.ExecuteQuery("core", sql, enumCommandType.SELECT, "DB216001", null); return(res); } catch (Exception ex) { ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
public static Result DB213003(DbConnections pDB, DateTime pCurDate) { Result res = new Result(); try { string sql = ""; sql = @"MERGE INTO CurrencyHist b USING ( SELECT Currency, :1 curdate, Rate, CashBuyRate, CashSellRate, NonCashBuyRate, NonCashSellRate, OLDRATE FROM Currency ) e ON (b.Currency = e.Currency and b.curdate = e.curdate) WHEN MATCHED THEN UPDATE SET b.Rate = e.Rate, b.CashBuyRate=e.CashBuyRate , b.CashSellRate=e.CashSellRate , b.NonCashBuyRate=e.NonCashBuyRate , b.NonCashSellRate=e.NonCashSellRate , b.OLDRATE=e.OLDRATE WHEN NOT MATCHED THEN insert (Currency, curdate, Rate, CashBuyRate, CashSellRate, NonCashBuyRate, NonCashSellRate, OLDRATE) values (e.Currency, :1, e.Rate, e.CashBuyRate, e.CashSellRate, e.NonCashBuyRate, e.NonCashSellRate, e.OLDRATE) "; res = pDB.ExecuteQuery("core", sql, enumCommandType.UPDATE, "DB213003", pCurDate); return(res); } catch (Exception ex) { res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
//PROCESS #region [ DB213016 - SELECT PROCESS ] public static Result DB213016(DbConnections pDB, object[] pParam) { Result res = new Result(); try { string sql = @" SELECT PID , DLLNAME , CLASSNAME , FUNCTIONNAME, DESCRIPTION , STATUS , freq FROM PROCESS ORDER BY PID "; res = pDB.ExecuteQuery("core", sql, enumCommandType.SELECT, "DB213016", null); return(res); } catch (Exception ex) { ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
/// <summary> /// Өгөгдсөн userno хэрэглэгчийн төлбөрийн төрлийн жагсаалтыг гаргах. /// Төлбөрийн төрлөөр олон мөр бичлэг буцаана. /// /// ucPayment панелаас дуудагдана. /// </summary> /// <param name="db"></param> /// <param name="pagenumber"></param> /// <param name="pagecount"></param> /// <param name="param">userno</param> /// <returns></returns> public static Result DB500008(DbConnections db, int pagenumber, int pagecount, object[] param) { Result res = new Result(); try { #region Prepare parameters #endregion #region Prepare query string sql = @" select /*+ first_rows(1) */ pt.typeid,pt.name,pt.suspaccount,0 paid from papaytype pt inner join papaytypeuser pu on pu.typeid=pt.typeid where pu.userno=:1 order by pt.orderno "; #endregion #region Execute query res = db.ExecuteQuery("core", sql, "DB500008", pagenumber, pagecount, param); #endregion return(res); } catch (Exception ex) { ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
/// <summary> /// Борлуулалтын төлбөрийн бичлэг оруулах /// ucPayment панелаас дуудаж байгаа. /// </summary> /// <param name="db"></param> /// <param name="pagenumber"></param> /// <param name="pagecount"></param> /// <param name="param">salesno,paymentno</param> /// <returns></returns> public static Result DB500203(DbConnections db, string salesno, string payno) { Result res = null; try { #region Prepare parameters #endregion #region Prepare query string sql = @" insert into salespayment (salesno,paymentno) values (:1,:2) "; #endregion #region Execute query res = db.ExecuteQuery("core", sql, enumCommandType.INSERT, "DB500203", salesno, payno); #endregion } catch (Exception ex) { res = new Result(); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); } return(res); }
/// <summary> /// Харилцагч дээр уягдсан тагийг салгах /// /// </summary> /// <param name="db"></param> /// <param name="pagenumber"></param> /// <param name="pagecount"></param> /// <param name="param"></param> /// <returns></returns> public static Result DB500021(DbConnections db, object[] param) { Result res = null; try { #region Prepare parameters decimal custno = Static.ToDecimal(param[0]); //string serialno = Static.ToStr(param[1]); #endregion #region Prepare query string sql = @" update customeriddevice set serialno=null where custno=:1 "; #endregion #region Execute query res = db.ExecuteQuery("core", sql, enumCommandType.UPDATE, "DB500021", custno); #endregion } catch (Exception ex) { ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res = new Result(); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; } return(res); }
/// <summary> /// Харилцагч дээр таг уях /// /// </summary> /// <param name="db"></param> /// <param name="pagenumber"></param> /// <param name="pagecount"></param> /// <param name="param"></param> /// <returns></returns> public static Result DB500020(DbConnections db, object[] param) { Result res = null; try { #region Prepare parameters decimal custno = Static.ToDecimal(param[0]); string serialno = Static.ToStr(param[1]); #endregion #region Prepare query string sql = @" merge into customeriddevice a using (select :1 custno,:2 serialno from dual) b on (a.custno=b.custno) when matched then update set a.serialno=b.serialno when not matched then insert (custno,serialno) values(b.custno,b.serialno) "; #endregion #region Execute query res = db.ExecuteQuery("core", sql, enumCommandType.UPDATE, "DB500020", custno, serialno); #endregion } catch (Exception ex) { ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res = new Result(); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; } return(res); }
/// <summary> /// Барьцаа дээр тайлбар оруулах /// /// </summary> /// <param name="db"></param> /// <param name="pagenumber"></param> /// <param name="pagecount"></param> /// <param name="param">custno, pledgeno</param> /// <returns></returns> public static Result DB500013(DbConnections db, object[] param) { DbConnection conn = null; Result res = null; try { #region Prepare parameters decimal custno = Static.ToDecimal(param[0]); string pledgeno = Static.ToStr(param[1]); string note = Static.ToStr(param[2]); #endregion #region Prepare query string sql = @" update pledgemain set note=:3 where custno=:1 and pledgeno=:2 "; #endregion #region Execute query res = db.ExecuteQuery("core", sql, enumCommandType.UPDATE, "DB500013", custno, pledgeno, note); #endregion } catch (Exception ex) { ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res = new Result(); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; } return(res); }
} //Гэрээнийн үндсэн мэдээлэл public Result Txn604004(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = null; try { #region Prepare parameters string contractno = Static.ToStr(ri.ReceivedParam[0]); #endregion #region Prepare query string sql = @"select prodno,prodtype from contractprod where contractno=:1 order by 1"; #endregion #region Execute query object[] param = new object[] { contractno }; res = db.ExecuteQuery("core", sql, enumCommandType.SELECT, "Txn604004", param); #endregion } catch (Exception ex) { res = new Result(9110002, "Програм руу нэвтрэхэд алдаа гарлаа" + ex.Message); } return(res); } //Гэрээнд хамрагдсан бараанууд
/// <summary> /// Борлуулалтын төлбөрийн бичлэг оруулах /// ucPayment панелаас дуудаж байгаа. /// </summary> /// <param name="db"></param> /// <param name="pagenumber"></param> /// <param name="pagecount"></param> /// <param name="param">salesno,billno,seqno,paytype,payamount,accountno</param> /// <returns></returns> public static Result DB500201(DbConnections db, object[] param) { Result res = new Result(); try { #region Prepare parameters string salesno = Static.ToStr(param[0]); int billno = Static.ToInt(param[1]); int seqno = Static.ToInt(param[2]); int paytype = Static.ToInt(param[3]); decimal payamount = Static.ToDecimal(param[4]); string accountno = Static.ToStr(param[5]); #endregion #region Prepare query string sql = @" insert into salespayment (salesno,billno,seqno,paytype,payamount,accountno) values (:1,:2,:3,:4,:5,:6) "; #endregion #region Execute query res = db.ExecuteQuery("core", sql, enumCommandType.INSERT, "DB500201", param); #endregion return(res); } catch (Exception ex) { ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
public static Result DB211037(DbConnections pDB, int pYear) { Result res = new Result(); try { string sql; sql = @" insert into CHARTBALANCEDAILY(ACCOUNT,BRANCHNO,CURCODE,txndate,OPENBAL,EndBal,DTBAL, CTBAL) select C.account, BR.branch, B.CURCODE, to_date(B.Year+1||'0101', 'yyyymmdd'), B.EndBal, B.EndBal, (CASE WHEN B.EndBal>0 THEN B.EndBal ELSE 0 END), (CASE WHEN B.EndBal<0 THEN B.EndBal ELSE 0 END) from CHARTBALANce B left join chart C on B.account=C.account left join Currency Cur on CUR.CURRENCY=B.CurCode right join branch BR on BR.branch=B.branchno where B.EndBal<>0 and B.year=:1 "; res = pDB.ExecuteQuery("core", sql, enumCommandType.SELECT, "DB211037", pYear); return(res); } catch (Exception ex) { EServ.Shared.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
public static Result DB211038(DbConnections pDB) { Result res = new Result(); try { string sql = @"update bacaccount set TMPYEARBALANCE=balance, balance=0 where accountno in ( select a.accountno from bacaccount a left join bacproduct b on a.prodcode=b.prodcode where b.type in (1,2) and a.balance<>0)"; res = pDB.ExecuteQuery("core", sql, enumCommandType.UPDATE, "DB211038"); return(res); } catch (Exception ex) { ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
} //Барьцаа шинээр үүсгэх public Result Txn601002(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = null; try { #region Prepare parameters string pledgeno = Static.ToStr(ri.ReceivedParam[0]); int typeid = Static.ToInt(ri.ReceivedParam[1]); string docno = Static.ToStr(ri.ReceivedParam[2]); string custname = Static.ToStr(ri.ReceivedParam[3]); string phone = Static.ToStr(ri.ReceivedParam[4]); string memo = Static.ToStr(ri.ReceivedParam[5]); #endregion #region Update string sql = @"update pledgedoc set doctype=:2,docno=:3,custno=:4,custname=:5,contact=:6,memo=:7) where pledgeno=:1 "; object[] param = new object[] { pledgeno, typeid, docno, custname, phone, memo }; res = db.ExecuteQuery("core", sql, enumCommandType.UPDATE, "Txn601002", param); #endregion } catch (Exception ex) { res = new Result(9110002, "Програм руу нэвтрэхэд алдаа гарлаа" + ex.Message); } return(res); } //Барьцаа засах
public static Result DB213017(DbConnections pDB, object[] pParam) { Result res = new Result(); try { string sql = @"UPDATE PROCESS SET DLLNAME=:2 , CLASSNAME=:3 , FUNCTIONNAME=:4, DESCRIPTION=:5 , STATUS =:6,freq=:7 WHERE PID=:1"; res = pDB.ExecuteQuery("core", sql, enumCommandType.UPDATE, "DB213017", pParam); res = F_Error(res); return(res); } catch (Exception ex) { ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
} //Барьцаанаас үйлчлүүлэгч салгах public Result Txn601007(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = null; try { #region Prepare parameters string tagno = Static.ToStr(ri.ReceivedParam[0]); #endregion #region SQL string sql = @"select p.pledgeno,p.custno,d.serialno from pledgemain p left join customeriddevice d on d.custno=p.custno where d.serialno=:1"; object[] param = new object[] { tagno }; res = db.ExecuteQuery("core", sql, enumCommandType.SELECT, "Txn601007", param); #endregion } catch (Exception ex) { res = new Result(9110002, "Програм руу нэвтрэхэд алдаа гарлаа" + ex.Message); } return(res); } //Тагны дугаараар барьцааны дугаар олох
public static Result DB213027(DbConnections pDB) { Result res = new Result(); try { string sql = @" select SP.SalesNo, PD.PaymentType, PD.Amount, PD.PaymentFlag, PD.ContractNo, decode(PD.PaymentFlag, 0, c.accountno, 1, p.SUSPACCOUNT) as accountno from SALESPAYMENTDETAIL PD left join SALESPAYMENT SP on SP.PaymentNo=PD.PaymentNo left join papaytype p on pd.PAYMENTTYPE=p.TYPEID left join contractmain c on pd.contractno=c.contractno order by SalesNo, PaymentType "; res = pDB.ExecuteQuery("core", sql, enumCommandType.SELECT, "DB213027", null); return(res); } catch (Exception ex) { res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
} //Тагтай түрээсийн хэрэгслийн лавлагаа public Result Txn606003(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = null; try { #region Prepare parameters string serialno = Static.ToStr(ri.ReceivedParam[0]); #endregion #region Тагийн төлвийн шалгах //Хүчингүй, танигдахгүй, эсвэл хураагдсан таг эсэхийг шалгах. #endregion #region Prepare sql string sql = @"select cid.custno,cid.serialno ,decode(c.classcode,1,c.corporatename, c.lastname||' '||c.firstname) custname ,c.sex,c.membertype,cr.name ratename,c.mobile,c.telephone,c.homephone,c.height,c.foot from customeriddevice cid left join customer c on c.customerno=cid.custno left join custrate cr on cr.ratecode=c.ratecode where cid.serialno=:1"; #endregion object[] param = new object[] { serialno }; res = db.ExecuteQuery("core", sql, enumCommandType.SELECT, "Txn606003", param); } catch (Exception ex) { res = new Result(9110001, "Датабааз руу хандахад алдаа гарлаа.\r\n" + ex.Message); } return(res); } //Тагтай үйлчлүүлэгчдийн лавлагаа
public static Result DB203201(DbConnections pDB, long pLogID) { Result res = new Result(); try { string sql; sql = @"SELECT LOGID, TABLENAME, FIELDNAME, OLDVALUE, NEWVALUE FROM LOGDETAIL WHERE LOGID=:1 ORDER BY LOGID, TABLENAME, FIELDNAME"; res = pDB.ExecuteQuery("core", sql, enumCommandType.SELECT, "DB203201", pLogID); return(res); } catch (Exception ex) { ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
} //Хүлээн авсан хэрэгсэлд тайлбар оруулах public Result Txn606009(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = new Result(); try { #region Prepare parameters object[] param = ri.ReceivedParam; string salesno = Static.ToStr(param[0]); decimal custno = Static.ToDecimal(param[1]); string prodno = Static.ToStr(param[2]); int itemno = Static.ToInt(param[3]); #endregion #region Prepare query string sql = @"select damagetype,damagenote,losspaymentno,deliveruser,receiveruser ,rentstatus,trunc((rentendtime-rentstarttime)*1440) duration from salesrent where salesno=:1 and custno=:2 and prodno=:3 and itemno=:4"; #endregion #region Execute query param = new object[] { salesno, custno, prodno, itemno }; res = db.ExecuteQuery("core", sql, enumCommandType.SELECT, "Txn606008", param); #endregion return(res); } catch (Exception ex) { res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } } //Эвдрэлийн мэдээлэл лавлах
} //Захиалга хайж жагсаалт авах public Result Txn603002(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = null; try { #region Prepare parameters string orderno = Static.ToStr(ri.ReceivedParam[0]); #endregion #region Prepare query string sql = @"select p.custno,c.registerno ,decode(c.classcode,1,c.corporatename, c.lastname||' '||c.firstname) custname ,d.serialno,decode(p.custno,o.custno,1,0) owner from orderperson p left join orders o on o.orderno=p.orderno left join customeriddevice d on d.custno=p.custno left join customer c on c.customerno=p.custno where p.orderno=:1"; #endregion #region Execute query object[] param = new object[] { orderno }; res = db.ExecuteQuery("core", sql, enumCommandType.SELECT, "Txn603002", param); #endregion } catch (Exception ex) { res = new Result(9110002, "Програм руу нэвтрэхэд алдаа гарлаа" + ex.Message); } return(res); } //Захиалгад хамрагдсан үйлчлүүлэгчид
public static Result DB211027(DbConnections pDB, long pJrNo) { Result res = new Result(); try { string sql; sql = @"Update ChartTxn set Corr=1 where JrNo=:1"; res = pDB.ExecuteQuery("core", sql, enumCommandType.UPDATE, "DB211027", pJrNo); return(res); } catch (Exception ex) { EServ.Shared.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
private Result GetTodayCashierTxn(ClientInfo ci, RequestInfo ri, DbConnections db, ref Log lg) { Result res = new Result(); string sql = ""; try { // Өнөөдөр хийгдсэн кассын илүүдэл дутагдлын гүйлгээ // debt>0 Илүүдэл, - sql = @"select T.Trandate, T.UserNo, U.DebitAcntNo, U.CreditAcntNo, T.Debt From shift T Left join hpuser U on u.userno=T.UserNo where T.status=2 and T.Debt<>0 and T.TxnDate=:1"; res = db.ExecuteQuery("core", sql, enumCommandType.SELECT, "GetTodayCashierTxn", Static.ToDate(ri.ReceivedParam[0])); return(res); } catch (Exception ex) { res.ResultNo = 9110002; res.ResultDesc = "Програм руу нэвтрэхэд алдаа гарлаа" + ex.Message; ISM.Lib.Static.WriteToLogFile("ProcessError.log", ex.Message + ex.Source + ex.StackTrace); return(res); } return(res); }
public static Result DB211016(DbConnections pDB, object[] pParam) { Result res = new Result(); try { string sql; sql = @"select Account,BranchNo,CurCode,TxnDate,DTBal,CTBal,OpenBal, EndBal from ChartBalanceDaily where TxnDate<:1 and branchNo=:2 and curcode=:3 and account=:4 and rownum<2 order by TxnDate desc"; res = pDB.ExecuteQuery("core", sql, enumCommandType.SELECT, "DB211016", pParam); return(res); } catch (Exception ex) { EServ.Shared.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
public static Result DB228006(DbConnections pDB, int taskid, int userno, long sourceid, DateTime systemdate) { Result res = new Result(); try { string sql = @" merge into markedtask a using (select :1 taskid,:2 userno,:3 sourceid,:4 checked from dual ) b on (a.taskid=b.taskid and a.userno=b.userno and a.sourceid=b.sourceid) when matched then update set a.status=1,a.checked=b.checked when not matched then insert (taskid,userno,sourceid,checked,status) values (b.taskid,b.userno,b.sourceid,b.checked,1) "; res = pDB.ExecuteQuery("core", sql, enumCommandType.SELECT, "DB228006", taskid, userno, sourceid, systemdate); return(res); } catch (Exception ex) { ISM.Lib.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }
public static Result DB211035(DbConnections pDB, object[] pParam) { Result res = new Result(); try { string sql; sql = @" update GLProcessList set StartDate = :1, EndDate = :2, Status=:3, ErrorDesc=:4 where TxnDate=:5 and ProcessNo=:6"; res = pDB.ExecuteQuery("core", sql, enumCommandType.UPDATE, "DB211035", pParam); return(res); } catch (Exception ex) { EServ.Shared.Static.WriteToLogFile("Error.log", ex.Message + ex.Source + ex.StackTrace); res.ResultNo = 9110001; res.ResultDesc = "Датабааз руу хандахад алдаа гарлаа" + ex.Message; return(res); } }