public void InsertSupplementReceipt(ReceiptClass rc) { //int Result = 0; try { Query = string.Format(@" exec sp_InsertSupplementReceipt @ReceiptNo='{0}', @BankID ={1} , @Price ={2} , @PayDate ='{3}' , @InsertTime ='{4}' , @ApproveFlag='{5}', @ApproveDate='{6}', @PayerName=N'{7}', @UserID ={8} , @Deleted ='{9}' , @IsSupplementReceipt ='{10}', @ParentReceiptID ={11},@ReceiptTypeValue={12},@RefID={13},@PostNodeCode={14} ,@ReceiptAlphabetSeri={15} ,@ReceiptNumberSeri={16},@IsPhish='{17}',@ChequeAccountNo='{18}',@ChequeComment='{19}' ,@ChequeSaderKonandeh='{20}',@ChequeVajh='{21}' " , rc.ReceiptSerialNo, rc.BankID, rc.Price, rc.PayDate, rc.InsertTime, rc.ApproveFlag, rc.ApproveDate, rc.PayerName, rc.UserID, rc.Deleted, rc.IsSupplementReceipt, rc.ParentID, rc.ReceiptTypeValue, rc.RefID, rc.PostNodeCode , rc.ReceiptAlphabetSeri, rc.ReceiptNumberSeri, rc.IsPhish, rc.ChequeAccountNo , rc.ChequeComment, rc.ChequeSaderKonandeh, rc.ChequeVajh); SqlExecute(Query); // Query = string.Format(@" select top 1 id from ReceiptInfo where ReceiptNo='{0}' AND BankID ={1} AND Price = {2} AND PayDate ='{3}' AND InsertTime ='{4}' // AND ApproveFlag='{5}' AND ApproveDate='{6}' AND PayerName='{7}' AND UserID ={8} AND Deleted ='{9}' // AND IsSupplementReceipt ='{10}' AND SupplementReceiptID ='{11}' " // , rc.ReceiptNo, rc.BankID, rc.Price, rc.PayDate, rc.InsertTime, rc.ApproveFlag, rc.ApproveDate, // rc.PayerName, rc.UserID, rc.Deleted, rc.IsSupplementReceipt, rc.SupplementReceiptID); // Result = Convert.ToInt32(SqlDataTable(Query).Rows[0][0]); } catch { } //return Result; }
public void SaveOtherReceiptInfo(int RefID) { ReceiptClass rc = new ReceiptClass(); rc.ReceiptSerialNo = _host.txtReceiptSerialNo.Text; rc.ReceiptAlphabetSeri = _host.ddlSeri.SelectedValue; rc.ReceiptNumberSeri = _host.txtSeri.Text.Trim(); rc.BankID = Convert.ToInt32(_host.ddl_bank.SelectedValue); rc.Price = Convert.ToUInt64(_host.txtPrice.Text); rc.PayDate = _host.ReceiptDate; rc.InsertTime = DateAndTime.GetTime8Digit(); rc.PayerName = _host.txtPayerName.Text; rc.UserID = UserInfo.UserId; rc.ReceiptTypeValue = Convert.ToUInt64(_host.ddlReceiptType.SelectedValue); rc.RefID = RefID; rc.PostNodeCode = UserInfo.PostNodeCode; rc.IsPhish = _host.ddlTypePrice.SelectedValue; if (_host.ddlTypePrice.SelectedValue == "0") { rc.ChequeAccountNo = _host.txtAccountNoCheque.Text.Trim(); rc.ChequeComment = _host.txtComment.Text.Trim(); rc.ChequeSaderKonandeh = _host.txtSaderKonandehCheque.Text.Trim(); rc.ChequeVajh = _host.txtVajehCheque.Text.Trim(); } BI.SaveOtherReceipt(rc); }
private ReceiptClass FillReceiptObject() { ReceiptClass _Receipt = new ReceiptClass(); _Receipt.IsPhish = _host.ddlTypePrice.SelectedValue; _Receipt.BankID = Convert.ToInt32(_host.ddl_bank.SelectedValue); _Receipt.InsertDate_SH = DateAndTime.GetDate10Digit(); _Receipt.InsertTime = DateAndTime.GetTime8Digit(); _Receipt.PayerName = _host.txtPayerName.Text.Trim(); _Receipt.Price = Convert.ToUInt64(_host.txtPrice.Text.Trim()); _Receipt.ReceiptSerialNo = _host.txtReceiptSerialNo.Text.Trim(); _Receipt.ReceiptNumberSeri = _host.txtSeri.Text.Trim(); _Receipt.ReceiptAlphabetSeri = _host.ddlSeri.SelectedValue.ToString(); _Receipt.PayDate = _host.ReceiptDate; _Receipt.UserID = UserInfo.UserId; _Receipt.PostNodeCode = UserInfo.PostNodeCode; if (_host.ddlTypePrice.SelectedValue == "0") { _Receipt.ChequeAccountNo = _host.txtAccountNoCheque.Text.Trim(); _Receipt.ChequeComment = _host.txtComment.Text.Trim(); _Receipt.ChequeSaderKonandeh = _host.txtSaderKonandehCheque.Text.Trim(); _Receipt.ChequeVajh = _host.txtVajehCheque.Text.Trim(); } return(_Receipt); }
private ReceiptClass FillOtherReceiptObject(UInt64 ReceiptID) { ReceiptClass rc = new ReceiptClass(); rc.ApproveFlag = "A"; rc.UserID = UserInfo.UserId; rc.PostNodeCode = UserInfo.PostNodeCode; rc.ParentID = ReceiptID; rc.ReceiptSerialNo = _host.txtReceiptNo.Text; rc.ReceiptNumberSeri = _host.txtSeri.Text; rc.ReceiptAlphabetSeri = _host.ddlSeri.SelectedValue; rc.Price = Convert.ToUInt64(_host.txtPrice.Text); rc.PayerName = _host.txtPayerName.Text; rc.IsPhish = _host.ddlTypePrice.SelectedValue; if (rc.IsPhish == "0") { rc.ChequeVajh = _host.txtVajehCheque.Text.Trim(); rc.ChequeAccountNo = _host.txtAccountNoCheque.Text.Trim(); rc.ChequeComment = _host.txtComment.Text.Trim(); rc.ChequeSaderKonandeh = _host.txtSaderKonandehCheque.Text.Trim(); } rc.PayDate = _host.PayDate; rc.IsSupplementReceipt = "Y"; rc.InsertTime = DateAndTime.GetTime8Digit(); rc.Description = ""; rc.Deleted = "N"; rc.BankID = Convert.ToInt32(_host.ddl_bank.SelectedValue); rc.ApproveDate = DateAndTime.GetDate10Digit(); rc.RefID = BI.ReturnRefIDByID(ReceiptID); rc.ReceiptTypeValue = Convert.ToUInt64(BI.ReturnReceiptTypeValueByID(ReceiptID.ToString())); return(rc); }
public string UpdateInfo(string SelectedID, string DontSelectedID, string RceiptID) { string Result = ""; try { ReceiptClass _Receipt = FillReceiptObject(); if (DontDisparityPriceWithArsenal(SelectedID, RceiptID) > -1) { if (BI.IsExistEqualOtherReceipt(_Receipt.ReceiptSerialNo, _Receipt.ReceiptNumberSeri, _Receipt.ReceiptAlphabetSeri, RceiptID)) { Result = "این فیش قبلا ثبت شده لطفا اطلاعات فیش را بررسی نمایید ."; return(Result); } BI.UpdateReceipt(_Receipt, RceiptID, DateAndTime.GetDate10Digit_latin(), DateAndTime.GetTime8Digit(), DateAndTime.GetDate10Digit()); BI.UpdateReceiptidInParcelList(SelectedID, DontSelectedID, RceiptID, DateAndTime.GetSQLDateTimeDigitMiladi(), DateAndTime.GetSQLDate10DigitShamsi()); Result = ""; } else { Result = "مبلغ فیش از مبالغ مرسولات کمتر است ."; } } catch { Result = "مشکل در بروز رسانی اطلاعات."; } return(Result); }
//int ParentReceiptID, public ReceiptClass ReturnReceiptInfoByID(int receiptID) { ReceiptClass rc = new ReceiptClass(); Query = string.Format(@"select id,ParentID,MasterReceiptID,PayDate,ReceiptSerialNo,BankID,Price,PayerName ,IsSupplementReceipt,ReceiptTypeValue,UpdateCount,RefID,ReceiptAlephabetSeri ,ReceiptNumberSeri,IsPhish,ISNULL(ChequeVajh,'--') as ChequeVajh ,ISNULL(ChequeSaderKonandeh,'--') as ChequeSaderKonandeh ,ISNULL(ChequeAccountNo,'--') as ChequeAccountNo,ISNULL(ChequeComment,'--') as ChequeComment from ReceiptInfo where id={0} " , receiptID); DataTable dt = SqlDataTable(Query); rc.RefID = Convert.ToInt32(dt.Rows[0]["RefID"].ToString()); rc.PayDate = dt.Rows[0]["PayDate"].ToString(); rc.PayerName = dt.Rows[0]["PayerName"].ToString(); rc.ID = Convert.ToInt32(dt.Rows[0]["id"].ToString()); rc.Price = Convert.ToUInt64(dt.Rows[0]["Price"].ToString()); rc.BankID = Convert.ToInt32(dt.Rows[0]["BankID"].ToString()); rc.ReceiptSerialNo = dt.Rows[0]["ReceiptSerialNo"].ToString(); rc.ParentID = Convert.ToUInt64(dt.Rows[0]["ParentID"].ToString()); rc.MasterReceiptID = Convert.ToInt32(dt.Rows[0]["MasterReceiptID"].ToString()); rc.ReceiptTypeValue = Convert.ToUInt64(dt.Rows[0]["ReceiptTypeValue"].ToString()); rc.UpdateCount = Convert.ToInt32(dt.Rows[0]["UpdateCount"].ToString()); rc.ReceiptAlphabetSeri = dt.Rows[0]["ReceiptAlephabetSeri"].ToString(); rc.IsSupplementReceipt = dt.Rows[0]["IsSupplementReceipt"].ToString(); rc.ChequeSaderKonandeh = dt.Rows[0]["ChequeSaderKonandeh"].ToString(); rc.ReceiptNumberSeri = dt.Rows[0]["ReceiptNumberSeri"].ToString(); rc.ChequeAccountNo = dt.Rows[0]["ChequeAccountNo"].ToString(); rc.RefID = Convert.ToInt32(dt.Rows[0]["RefID"].ToString()); rc.ChequeComment = dt.Rows[0]["ChequeComment"].ToString(); rc.ChequeVajh = dt.Rows[0]["ChequeVajh"].ToString(); rc.IsPhish = dt.Rows[0]["IsPhish"].ToString(); return(rc); }
public void UpdateReceiptInfoByFinancialUser(ReceiptClass receipt, string ApproveFlag, string FinancialMoodValue, string Description, string Date10Digit) { try { Query = string.Format(@"EXEC sp_UpdateParcelReceiptForLog @ReceiptNo={0} ,@BankID={1} ,@Price={2} ,@PayDate='{3}',@InsertDate_M='{4}' ,@InsertDate_SH='{5}' ,@InsertTime='{6}' ,@ApproveFlag='{7}' ,@ApproveDate='{8}' ,@PayerName='{9}' ,@UserID={10} ,@IsSupplementReceipt='{11}' ,@ChangeFlag='{12}' , @ReceiptID={13}, @ReceiptTypeValue={14} , @FinancialMoodValue = {15} , @Description = N'{16}' ,@ReceiptAlephabetSeri={17},@ReceiptNumberSeri={18} ,@IsPhish='' ,@ChequeVajh='' ,@ChequeSaderKonandeh='' ,@ChequeAccountNo='' ,@ChequeComment='' " , 0, 0, 0, 0 , "2015-05-24 17:45:26.973", 0 , 0, ApproveFlag, Date10Digit, 0 , 0, "N", "Y", receipt.ID, -1, FinancialMoodValue, Description , 0, 0); SqlExecute(Query); // Query = string.Format(@"exec sp_UpdateReceiptInfoByFinancialUser // @ID={0} , @ApproveDate='{1}' , @Description=N'{2}' ,@ApproveFlag='{3}'" // , receipt.ID, receipt.ApproveDate, receipt.Description, ApproveFlag); // SqlExecute(Query); } catch { } }
public void SaveReceiptInfo(string SelectedID) { try { ReceiptClass _Receipt = FillReceiptObject(); BI.SaveReceipt(_Receipt, SelectedID, Convert.ToInt16(_host.ddlReceiptType.SelectedValue)); ClearForm(); Load_dgBarcodeList(_host.hfMovazeh.Value, _host.Fdate, _host.Ldate); Load_dgReceiptList(); } catch { } }
private bool LoadDataForEdit(string ID) { try { ReceiptClass rc = new ReceiptClass(); rc = BI.ReturnReceiptInfoByID(Convert.ToInt32(ID)); //if (rc.ParentID == 0) // _host.txtParentSeri.Text= // _host.txtParentSeriAlphabet.Text= // _host.txtParentReceiptID.Text = "0"; //else //{ if (rc.IsSupplementReceipt == "Y") { BI.ReturnParentReceiptNoByReceiptID(rc.IsSupplementReceipt, rc.ParentID, out ParentSerialNo, out ParentNumberSeri, out ParentSeriAlphabet); } else { BI.ReturnParentReceiptNoByReceiptID(rc.IsSupplementReceipt, Convert.ToUInt64(rc.RefID), out ParentSerialNo, out ParentNumberSeri, out ParentSeriAlphabet); } _host.txtParentReceiptID.Text = ParentSerialNo; _host.txtParentSeri.Text = ParentNumberSeri; _host.txtParentSeriAlphabet.Text = ParentSeriAlphabet; //} _host.txtReceiptNo.Text = rc.ReceiptSerialNo; _host.txtPayerName.Text = rc.PayerName; _host.txtPrice.Text = rc.Price.ToString(); _host.PayDate = rc.PayDate; _host.ddl_bank.SelectedValue = rc.BankID.ToString(); _host.ddlReceiptType.SelectedValue = rc.ReceiptTypeValue.ToString(); _host.ddlSeri.SelectedValue = rc.ReceiptAlphabetSeri; _host.txtSeri.Text = rc.ReceiptNumberSeri; //_host.ddlTypePrice.SelectedValue = (rc.IsPhish == "Y" ? "1" :"0"); _host.ddlTypePrice.SelectedValue = rc.IsPhish; _host.txtSaderKonandehCheque.Text = rc.ChequeSaderKonandeh; _host.txtVajehCheque.Text = rc.ChequeVajh; _host.txtComment.Text = rc.ChequeComment; _host.txtAccountNoCheque.Text = rc.ChequeAccountNo; FormItemesVisible(rc.IsPhish); if (rc.IsSupplementReceipt == "Y") { return(true); } else { return(false); } } catch { return(false); } }
private ReceiptClass FillReceiptObject() { ReceiptClass _Receipt = new ReceiptClass(); _Receipt.BankID = Convert.ToInt32(_host.ddl_bank.SelectedValue); _Receipt.PayerName = _host.txtPayerName.Text.Trim(); _Receipt.Price = Convert.ToUInt64(_host.txtPrice.Text.Trim()); _Receipt.ReceiptSerialNo = _host.txtReceiptNo.Text.Trim(); _Receipt.ReceiptNumberSeri = _host.txtSeri.Text.Trim(); _Receipt.ReceiptAlphabetSeri = _host.ddlSeri.SelectedValue; _Receipt.PayDate = _host.ReceiptDate; _Receipt.UserID = UserInfo.UserId; return(_Receipt); }
public void SaveOtherReceipt(ReceiptClass rc) { try { Query = string.Format(@"Exec sp_InsertOtherReceiptInfo @ReceiptSerialNo='{0}',@BankID={1},@Price={2},@PayDate='{3}',@InsertTime='{4}' ,@PayerName='{5}',@UserID={6},@ReceiptTypeValue={7},@RefID={8},@PostNodeCode={9} ,@ReceiptAlephabetSeri={10},@ReceiptNumberSeri={11},@IsPhish='{12}',@ChequeVajh='{13}',@ChequeSaderKonandeh='{14}' ,@ChequeAccountNo='{14}',@ChequeComment='{15}'", rc.ReceiptSerialNo, rc.BankID, rc.Price , rc.PayDate, rc.InsertTime, rc.PayerName, rc.UserID, rc.ReceiptTypeValue, rc.RefID, rc.PostNodeCode , rc.ReceiptAlphabetSeri, rc.ReceiptNumberSeri, rc.IsPhish, rc.ChequeVajh , rc.ChequeSaderKonandeh, rc.ChequeAccountNo, rc.ChequeComment); SqlExecute(Query); } catch { } }
public void SaveReceipt(ReceiptClass ReceiptInfo, string SelectedID, Int16 ReceiptTypeValue) { // string ReceiptID = "0"; try { Query = string.Format(@"exec sp_InsertPostalReceiptInfo @ReceiptSerialNo='{0}',@BankID={1},@Price={2},@PayDate='{3}' ,@InsertDate_SH='{4}',@InsertTime='{5}',@PayerName=N'{6}',@UserId={7},@SelectedParcelsID='{8}',@PostNodeCode={9} ,@ReceiptAlphabetSeri='{10}',@ReceiptNumberSeri='{11}',@IsPhish='{12}',@ChequeAccountNo='{13}',@ChequeComment='{14}' ,@ChequeSaderKonandeh='{15}',@ChequeVajh='{16}',@ReceiptTypeValue={17} " , ReceiptInfo.ReceiptSerialNo, ReceiptInfo.BankID, ReceiptInfo.Price, ReceiptInfo.PayDate, ReceiptInfo.InsertDate_SH , ReceiptInfo.InsertTime, ReceiptInfo.PayerName, ReceiptInfo.UserID, SelectedID, ReceiptInfo.PostNodeCode , ReceiptInfo.ReceiptAlphabetSeri, ReceiptInfo.ReceiptNumberSeri, ReceiptInfo.IsPhish, ReceiptInfo.ChequeAccountNo , ReceiptInfo.ChequeComment, ReceiptInfo.ChequeSaderKonandeh, ReceiptInfo.ChequeVajh, ReceiptTypeValue); SqlExecute(Query); //ReceiptID = SqlDataTable(Query).Rows[0][0].ToString(); } catch { } // return ReceiptID; }
public void LoadReceiptInfo(string ReceiptID) { ReceiptClass rc = new ReceiptClass(); rc = BI.ReturnReceiptInfoByID(Convert.ToInt32(ReceiptID)); _host.txtPayerName.Text = rc.PayerName; _host.txtPrice.Text = rc.Price.ToString(); _host.txtReceiptNo.Text = rc.ReceiptSerialNo; _host.txtSeri.Text = rc.ReceiptNumberSeri; _host.ddlSeri.SelectedValue = rc.ReceiptAlphabetSeri; _host.ddl_bank.SelectedValue = rc.BankID.ToString(); _host.ReceiptDate = rc.PayDate; _host.txtSaderKonandehCheque.Text = rc.ChequeSaderKonandeh; _host.txtAccountNoCheque.Text = rc.ChequeAccountNo; _host.txtVajehCheque.Text = rc.ChequeVajh; _host.txtComment.Text = rc.ChequeComment; _host.ddlTypePrice.SelectedValue = (rc.IsPhish == "0"?"0":"1"); FormItemesVisible(_host.ddlTypePrice.SelectedValue); }
public void UpdateOtherReceipt(ReceiptClass _Receipt, string Date10Digit_latin, string Time8Digit, string Date10Digit) { try { Query = string.Format(@"EXEC sp_UpdateParcelReceiptForLog @ReceiptNo={0} ,@BankID={1} ,@Price={2} ,@PayDate='{3}',@InsertDate_M='{4}' ,@InsertDate_SH='{5}' ,@InsertTime='{6}' ,@ApproveFlag='{7}' ,@ApproveDate='{8}' ,@PayerName='{9}' ,@UserID={10} ,@IsSupplementReceipt='{11}',@ChangeFlag='{12}' ,@ReceiptID={13},@ReceiptTypeValue={14},@FinancialMoodValue={15}, @Description = N'{16}' ,@ReceiptAlephabetSeri={17},@ReceiptNumberSeri={18},@IsPhish='{19}',@ChequeVajh='{20}',@ChequeSaderKonandeh='{21}' ,@ChequeAccountNo='{22}',@ChequeComment='{23}'" , _Receipt.ReceiptSerialNo, _Receipt.BankID, _Receipt.Price, _Receipt.PayDate , Date10Digit_latin + " " + Time8Digit, Date10Digit , Time8Digit, "D", Date10Digit, _Receipt.PayerName , _Receipt.UserID, "N", "N", _Receipt.ID, _Receipt.ReceiptTypeValue, -1, "" , _Receipt.ReceiptAlphabetSeri, _Receipt.ReceiptNumberSeri, _Receipt.IsPhish, _Receipt.ChequeVajh , _Receipt.ChequeSaderKonandeh, _Receipt.ChequeAccountNo, _Receipt.ChequeComment); SqlExecute(Query); } catch { } }
private ReceiptClass FillSupplementReceipt(int ID) { ReceiptClass rc = new ReceiptClass(); rc.ID = ID; rc.BankID = Convert.ToInt32(_host.ddl_bank.SelectedValue); rc.ParentID = Convert.ToUInt64(_host.txtParentReceiptID.Text); rc.PayDate = _host.PayDate; rc.PayerName = _host.txtPayerName.Text; rc.ReceiptSerialNo = _host.txtReceiptNo.Text; rc.ReceiptNumberSeri = _host.txtSeri.Text; rc.ReceiptAlphabetSeri = _host.ddlSeri.SelectedValue; rc.Price = Convert.ToUInt64(_host.txtPrice.Text); rc.UserID = UserInfo.UserId; rc.IsPhish = _host.ddlTypePrice.SelectedValue; if (rc.IsPhish == "0") { rc.ChequeVajh = _host.txtVajehCheque.Text.Trim(); rc.ChequeAccountNo = _host.txtAccountNoCheque.Text.Trim(); rc.ChequeComment = _host.txtComment.Text.Trim(); rc.ChequeSaderKonandeh = _host.txtSaderKonandehCheque.Text.Trim(); } return(rc); }
public void UpdateSupplementReceipt(int ID) { RC = FillSupplementReceipt(ID); BI.UpdateSupplementReceipt(RC, DateAndTime.GetDate10Digit_latin(), DateAndTime.GetTime8Digit(), DateAndTime.GetDate10Digit()); }
public void SaveSupplementReceipt(int ParentReceiptID) { RC = FillReceiptObject(ParentReceiptID); BI.InsertSupplementReceipt(RC); }
public void SaveSupplementForOtherReceipt(UInt64 ReceiptID) { RC = FillOtherReceiptObject(ReceiptID); BI.InsertSupplementReceipt(RC); }