/// <summary>
 /// Edit function
 /// </summary>
 public void EditFunction()
 {
     try
     {
         SuffixPrefixSettingsBll BllSuffixPrefixSettings = new SuffixPrefixSettingsBll();
         SuffixPrefixInfo        infoSuffixPrefix        = new SuffixPrefixInfo();
         infoSuffixPrefix.FromDate = Convert.ToDateTime(txtFromDate.Text.ToString());
         infoSuffixPrefix.ToDate   = Convert.ToDateTime(txtToDate.Text.ToString());
         String strvouchertype = (cmbVoucherType.SelectedValue.ToString());
         infoSuffixPrefix.VoucherTypeId = Convert.ToDecimal(strvouchertype.ToString());
         infoSuffixPrefix.Prefix        = txtPrefix.Text.Trim();
         infoSuffixPrefix.Suffix        = txtSufix.Text.Trim();
         infoSuffixPrefix.StartIndex    = Convert.ToDecimal(txtStartIndex.Text.ToString());
         if (cbxPrefillWithZero.Checked)
         {
             infoSuffixPrefix.PrefillWithZero      = true;
             infoSuffixPrefix.WidthOfNumericalPart = Convert.ToInt32(txtWidthofNumericalPart.Text.ToString());
         }
         else
         {
             infoSuffixPrefix.PrefillWithZero      = false;
             infoSuffixPrefix.WidthOfNumericalPart = 0;
         }
         infoSuffixPrefix.Narration      = txtNarration.Text.Trim();
         infoSuffixPrefix.Extra1         = string.Empty;
         infoSuffixPrefix.Extra2         = string.Empty;
         infoSuffixPrefix.SuffixprefixId = decSuffixPrefixId;
         if (BllSuffixPrefixSettings.SuffixPrefixCheckExistenceForAdd(txtFromDate.Text.ToString(), txtToDate.Text.ToString(), Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()), decSuffixPrefixId) == false)
         {
             if (BllSuffixPrefixSettings.SuffixPrefixSettingsEdit(infoSuffixPrefix))
             {
                 Messages.UpdatedMessage();
                 Clear();
             }
             else
             {
                 Messages.ReferenceExistsMessageForUpdate();
                 cmbVoucherType.Focus();
             }
         }
         else
         {
             Messages.InformationMessage("Voucher type already exist for  dates");
             cmbVoucherType.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPS5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// grid double click fill the items in controll for edit
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvSuffixPrefixSettings_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex != -1)
                {
                    SuffixPrefixSettingsBll BllSuffixPrefixSettings = new SuffixPrefixSettingsBll();

                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                    infoSuffixPrefix             = BllSuffixPrefixSettings.SuffixPrefixView(Convert.ToDecimal(dgvSuffixPrefixSettings.Rows[e.RowIndex].Cells["dgvtxtSuffixPrefixId"].Value.ToString()));
                    decSuffixPrefixId            = Convert.ToDecimal(dgvSuffixPrefixSettings.Rows[e.RowIndex].Cells["dgvtxtSuffixPrefixId"].Value.ToString());
                    txtFromDate.Text             = infoSuffixPrefix.FromDate.ToString("dd-MMM-yyyy");
                    txtToDate.Text               = infoSuffixPrefix.ToDate.ToString("dd-MMM-yyyy");
                    cmbVoucherType.SelectedValue = infoSuffixPrefix.VoucherTypeId.ToString();
                    txtStartIndex.Text           = infoSuffixPrefix.StartIndex.ToString();
                    txtStartIndex.Enabled        = false;
                    txtSufix.Text  = infoSuffixPrefix.Suffix;
                    txtPrefix.Text = infoSuffixPrefix.Prefix;
                    if (infoSuffixPrefix.PrefillWithZero == true)
                    {
                        cbxPrefillWithZero.Checked   = true;
                        txtWidthofNumericalPart.Text = infoSuffixPrefix.WidthOfNumericalPart.ToString();
                    }
                    else
                    {
                        cbxPrefillWithZero.Checked   = false;
                        txtWidthofNumericalPart.Text = infoSuffixPrefix.WidthOfNumericalPart.ToString();
                    }
                    txtNarration.Text = infoSuffixPrefix.Narration;
                    btnSave.Text      = "Update";
                    btnDelete.Enabled = true;
                    txtFromDate.Focus();
                    txtWidthofNumericalPart.Enabled = true;
                    if (cbxPrefillWithZero.Checked == true)
                    {
                        txtWidthofNumericalPart.Enabled = true;
                    }
                    else
                    {
                        txtWidthofNumericalPart.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("SPS20" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#3
0
 /// <summary>
 /// Function to Update values in SuffixPrefix Table
 /// </summary>
 /// <param name="suffixprefixinfo"></param>
 public void SuffixPrefixEdit(SuffixPrefixInfo suffixprefixinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("SuffixPrefixEdit", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@suffixprefixId", SqlDbType.Decimal);
         sprmparam.Value = suffixprefixinfo.SuffixprefixId;
         sprmparam = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
         sprmparam.Value = suffixprefixinfo.VoucherTypeId;
         sprmparam = sccmd.Parameters.Add("@fromDate", SqlDbType.DateTime);
         sprmparam.Value = suffixprefixinfo.FromDate;
         sprmparam = sccmd.Parameters.Add("@toDate", SqlDbType.DateTime);
         sprmparam.Value = suffixprefixinfo.ToDate;
         sprmparam = sccmd.Parameters.Add("@startIndex", SqlDbType.Decimal);
         sprmparam.Value = suffixprefixinfo.StartIndex;
         sprmparam = sccmd.Parameters.Add("@prefix", SqlDbType.VarChar);
         sprmparam.Value = suffixprefixinfo.Prefix;
         sprmparam = sccmd.Parameters.Add("@suffix", SqlDbType.VarChar);
         sprmparam.Value = suffixprefixinfo.Suffix;
         sprmparam = sccmd.Parameters.Add("@widthOfNumericalPart", SqlDbType.Int);
         sprmparam.Value = suffixprefixinfo.WidthOfNumericalPart;
         sprmparam = sccmd.Parameters.Add("@prefillWithZero", SqlDbType.Bit);
         sprmparam.Value = suffixprefixinfo.PrefillWithZero;
         sprmparam = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam.Value = suffixprefixinfo.Narration;
         sprmparam = sccmd.Parameters.Add("@extraDate", SqlDbType.DateTime);
         sprmparam.Value = suffixprefixinfo.ExtraDate;
         sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = suffixprefixinfo.Extra1;
         sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = suffixprefixinfo.Extra2;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
 /// <summary>
 /// Function to Update values in SuffixPrefix Table
 /// </summary>
 /// <param name="suffixprefixinfo"></param>
 public void SuffixPrefixEdit(SuffixPrefixInfo suffixprefixinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("SuffixPrefixEdit", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam       = sccmd.Parameters.Add("@suffixprefixId", SqlDbType.Decimal);
         sprmparam.Value = suffixprefixinfo.SuffixprefixId;
         sprmparam       = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
         sprmparam.Value = suffixprefixinfo.VoucherTypeId;
         sprmparam       = sccmd.Parameters.Add("@fromDate", SqlDbType.DateTime);
         sprmparam.Value = suffixprefixinfo.FromDate;
         sprmparam       = sccmd.Parameters.Add("@toDate", SqlDbType.DateTime);
         sprmparam.Value = suffixprefixinfo.ToDate;
         sprmparam       = sccmd.Parameters.Add("@startIndex", SqlDbType.Decimal);
         sprmparam.Value = suffixprefixinfo.StartIndex;
         sprmparam       = sccmd.Parameters.Add("@prefix", SqlDbType.VarChar);
         sprmparam.Value = suffixprefixinfo.Prefix;
         sprmparam       = sccmd.Parameters.Add("@suffix", SqlDbType.VarChar);
         sprmparam.Value = suffixprefixinfo.Suffix;
         sprmparam       = sccmd.Parameters.Add("@widthOfNumericalPart", SqlDbType.Int);
         sprmparam.Value = suffixprefixinfo.WidthOfNumericalPart;
         sprmparam       = sccmd.Parameters.Add("@prefillWithZero", SqlDbType.Bit);
         sprmparam.Value = suffixprefixinfo.PrefillWithZero;
         sprmparam       = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam.Value = suffixprefixinfo.Narration;
         sprmparam       = sccmd.Parameters.Add("@extraDate", SqlDbType.DateTime);
         sprmparam.Value = suffixprefixinfo.ExtraDate;
         sprmparam       = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = suffixprefixinfo.Extra1;
         sprmparam       = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = suffixprefixinfo.Extra2;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
        /// <summary>
        /// Function to get SuffixPrefix details based on parameter
        /// </summary>
        /// <param name="vouchertypeId"></param>
        /// <param name="date"></param>
        /// <returns></returns>
        public SuffixPrefixInfo GetSuffixPrefixDetails(decimal vouchertypeId, DateTime date)
        {
            SuffixPrefixInfo suffixprefixinfo = new SuffixPrefixInfo();
            SqlDataReader    sdrreader        = null;

            try
            {
                if (sqlcon.State == ConnectionState.Closed)
                {
                    sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("GetSuffixPrefixDetails", sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam = new SqlParameter();
                sprmparam       = sccmd.Parameters.Add("@voucherId", SqlDbType.Decimal);
                sprmparam.Value = vouchertypeId;
                sprmparam       = sccmd.Parameters.Add("@date", SqlDbType.DateTime);
                sprmparam.Value = date;
                sdrreader       = sccmd.ExecuteReader();
                while (sdrreader.Read())
                {
                    suffixprefixinfo.SuffixprefixId       = decimal.Parse(sdrreader[0].ToString());
                    suffixprefixinfo.VoucherTypeId        = decimal.Parse(sdrreader[1].ToString());
                    suffixprefixinfo.FromDate             = DateTime.Parse(sdrreader[2].ToString());
                    suffixprefixinfo.ToDate               = DateTime.Parse(sdrreader[3].ToString());
                    suffixprefixinfo.StartIndex           = decimal.Parse(sdrreader[4].ToString());
                    suffixprefixinfo.Prefix               = sdrreader[5].ToString();
                    suffixprefixinfo.Suffix               = sdrreader[6].ToString();
                    suffixprefixinfo.WidthOfNumericalPart = int.Parse(sdrreader[7].ToString());
                    suffixprefixinfo.PrefillWithZero      = bool.Parse(sdrreader[8].ToString());
                    suffixprefixinfo.Narration            = sdrreader[9].ToString();
                    suffixprefixinfo.ExtraDate            = DateTime.Parse(sdrreader[10].ToString());
                    suffixprefixinfo.Extra1               = sdrreader[11].ToString();
                    suffixprefixinfo.Extra2               = sdrreader[12].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sdrreader.Close();
                sqlcon.Close();
            }
            return(suffixprefixinfo);
        }
示例#6
0
 /// <summary>
 /// save function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         SuffixPrefixSP   spSuffixPrefix   = new SuffixPrefixSP();
         SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
         infoSuffixPrefix.FromDate = Convert.ToDateTime(txtFromDate.Text.ToString());
         infoSuffixPrefix.ToDate   = Convert.ToDateTime(txtToDate.Text.ToString());
         String strvouchertype = (cmbVoucherType.SelectedValue.ToString());
         infoSuffixPrefix.VoucherTypeId = Convert.ToDecimal(strvouchertype.ToString());
         infoSuffixPrefix.Suffix        = txtSufix.Text.Trim();
         infoSuffixPrefix.Prefix        = txtPrefix.Text.Trim();
         infoSuffixPrefix.StartIndex    = Convert.ToDecimal(txtStartIndex.Text.ToString());
         if (cbxPrefillWithZero.Checked)
         {
             infoSuffixPrefix.PrefillWithZero      = true;
             infoSuffixPrefix.WidthOfNumericalPart = Convert.ToInt32(txtWidthofNumericalPart.Text.ToString());
         }
         else
         {
             infoSuffixPrefix.PrefillWithZero      = false;
             infoSuffixPrefix.WidthOfNumericalPart = 0;
         }
         infoSuffixPrefix.Narration = txtNarration.Text.Trim();
         infoSuffixPrefix.Extra1    = string.Empty;
         infoSuffixPrefix.Extra2    = string.Empty;
         if (spSuffixPrefix.SuffixPrefixCheckExistenceForAdd(txtFromDate.Text.ToString(), txtToDate.Text.ToString(), Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()), 0) == false)
         {
             if (spSuffixPrefix.SuffixPrefixAddWithId(infoSuffixPrefix))
             {
                 Messages.SavedMessage();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage("Voucher type already exist for  dates");
             cmbVoucherType.Focus();
         }
     }
     catch (Exception ex)
     {
         formMDI.infoError.ErrorString = "SPS4" + ex.Message;
     }
 }
        /// <summary>
        /// Function to get id for suffixprefix insert
        /// </summary>
        /// <param name="Infosuffixprefix"></param>
        /// <returns></returns>
        public bool SuffixPrefixAddWithId(SuffixPrefixInfo Infosuffixprefix)
        {
            bool isSave = false;

            try
            {
                if (sqlcon.State == ConnectionState.Closed)
                {
                    sqlcon.Open();
                }
                SqlCommand sqlcmd = new SqlCommand("SuffixPrefixAddWithId", sqlcon);
                sqlcmd.CommandType = CommandType.StoredProcedure;
                sqlcmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal).Value        = Infosuffixprefix.VoucherTypeId;
                sqlcmd.Parameters.Add("@fromDate", SqlDbType.DateTime).Value            = Infosuffixprefix.FromDate;
                sqlcmd.Parameters.Add("@toDate", SqlDbType.DateTime).Value              = Infosuffixprefix.ToDate;
                sqlcmd.Parameters.Add("@startIndex", SqlDbType.Decimal).Value           = Infosuffixprefix.StartIndex;
                sqlcmd.Parameters.Add("@prefix", SqlDbType.VarChar).Value               = Infosuffixprefix.Prefix;
                sqlcmd.Parameters.Add("@suffix", SqlDbType.VarChar).Value               = Infosuffixprefix.Suffix;
                sqlcmd.Parameters.Add("@widthOfNumericalPart", SqlDbType.Decimal).Value = Infosuffixprefix.WidthOfNumericalPart;
                sqlcmd.Parameters.Add("@prefillWithZero", SqlDbType.Bit).Value          = Infosuffixprefix.PrefillWithZero;
                sqlcmd.Parameters.Add("@narration", SqlDbType.VarChar).Value            = Infosuffixprefix.Narration;
                sqlcmd.Parameters.Add("@extra1", SqlDbType.VarChar).Value               = Infosuffixprefix.Extra1;
                sqlcmd.Parameters.Add("@extra2", SqlDbType.VarChar).Value               = Infosuffixprefix.Extra2;
                int ineffectedrow = sqlcmd.ExecuteNonQuery();
                if (ineffectedrow > 0)
                {
                    isSave = true;
                }
                else
                {
                    isSave = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sqlcon.Close();
            }
            return(isSave);
        }
示例#8
0
 /// <summary>
 /// Function to generate Voucher number as per settings
 /// </summary>
 public void VoucherNoGeneration()
 {
     string strRejectionIn = "RejectionInMaster";
     string strSuffix = string.Empty;
     string strPrefix = string.Empty;
     string strInvoiceNo = string.Empty;
     try
     {
         if (strVoucherNo == string.Empty)
         {
             strVoucherNo = "0";
         }
         strVoucherNo = transactionGeneralFillObj.VoucherNumberAutomaicGeneration(decRejectionInVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, strRejectionIn);
         if (isAutomatic)
         {
             SuffixPrefixSP spSuffixPrefix = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix = spSuffixPrefix.GetSuffixPrefixDetails(decRejectionInVoucherTypeId, dtpDate.Value);
             strPrefix = infoSuffixPrefix.Prefix;
             strSuffix = infoSuffixPrefix.Suffix;
             strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
             txtRejectionInNo.Text = strInvoiceNo;
             txtRejectionInNo.Enabled = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("RI:03" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#9
0
 /// <summary>
 /// Function to get id for update
 /// </summary>
 /// <param name="Infosuffixprefix"></param>
 /// <returns></returns>
 public bool SuffixPrefixSettingsEdit(SuffixPrefixInfo Infosuffixprefix)
 {
     bool isEdit = false;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sqlcmd = new SqlCommand("SuffixPrefixSettingsEdit", sqlcon);
         sqlcmd.CommandType = CommandType.StoredProcedure;
         sqlcmd.Parameters.Add("@suffixprefixId", SqlDbType.Decimal).Value = Infosuffixprefix.SuffixprefixId;
         sqlcmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal).Value = Infosuffixprefix.VoucherTypeId;
         sqlcmd.Parameters.Add("@fromDate", SqlDbType.DateTime).Value = Infosuffixprefix.FromDate;
         sqlcmd.Parameters.Add("@toDate", SqlDbType.DateTime).Value = Infosuffixprefix.ToDate;
         sqlcmd.Parameters.Add("@startIndex", SqlDbType.VarChar).Value = Infosuffixprefix.StartIndex;
         sqlcmd.Parameters.Add("@prefix", SqlDbType.VarChar).Value = Infosuffixprefix.Prefix;
         sqlcmd.Parameters.Add("@suffix", SqlDbType.VarChar).Value = Infosuffixprefix.Suffix;
         sqlcmd.Parameters.Add("@widthOfNumericalPart", SqlDbType.Decimal).Value = Infosuffixprefix.WidthOfNumericalPart;
         sqlcmd.Parameters.Add("@prefillWithZero", SqlDbType.Bit).Value = Infosuffixprefix.PrefillWithZero;
         sqlcmd.Parameters.Add("@narration", SqlDbType.VarChar).Value = Infosuffixprefix.Narration;
         int ineffectedrow = sqlcmd.ExecuteNonQuery();
         if (ineffectedrow > 0)
         {
             isEdit = true;
         }
         else
         {
             isEdit = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
     return isEdit;
 }
示例#10
0
 /// <summary>
 /// Function to call this form from VoucherType Selection form
 /// </summary>
 public void CallFromVoucherTypeSelection(decimal decStockJournalVoucherTypeId, string strSockJournalVocherTypeName)//used for vouchertype selection while open the form
 {
     try
     {
         decVoucherTypeId = decStockJournalVoucherTypeId;
         VoucherTypeSP spVoucherType = new VoucherTypeSP();
         isAutomatic = spVoucherType.CheckMethodOfVoucherNumbering(decStockJournalVoucherTypeId);
         SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
         SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
         infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decStockJournalVoucherTypeId, dtpDate.Value);
         decSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
         this.Text = strSockJournalVocherTypeName;
         base.Show();
         if (isAutomatic)
         {
             txtDate.Focus();
         }
         else
         {
             txtVoucherNo.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SJ:24" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// Function to call this form from frmVoucherTypeSelection form 
        /// </summary>
        /// <param name="decVoucherTypeId"></param>
        /// <param name="strVoucherTypeName"></param>
        public void CallFromVoucherTypeSelection(decimal decVoucherTypeId, string strVoucherTypeName)
        {
            try
            {
                decMonthlyVoucherTypeId = decVoucherTypeId;
                VoucherTypeSP spVoucherType = new VoucherTypeSP();
                isAutomatic = spVoucherType.CheckMethodOfVoucherNumbering(decMonthlyVoucherTypeId);
                SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decMonthlyVoucherTypeId, dtpVoucherDate.Value);
                decMonthlySuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
                this.Text = strVoucherTypeName;
                base.Show();
                if (isAutomatic)
                {
                    txtVoucherDate.Focus();
                }
                else
                {
                    txtVoucherNo.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("MSV3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
示例#12
0
        /// <summary>
        /// To reset the form here and Generate the voucher no generation
        /// </summary>
        public void Clear()
        {
            try
            {
                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                if (btnSave.Text == "Update")
                {
                    if (frmPaymentRegisterObj != null)
                    {
                        frmPaymentRegisterObj.Close();
                    }
                }
                if (isAutomatic)
                {

                    SalaryVoucherMasterSP spMaster = new SalaryVoucherMasterSP();
                    PaymentMasterSP SpPaymentMaster = new PaymentMasterSP();
                    if (strVoucherNo == string.Empty)
                    {
                        strVoucherNo = "0";
                    }
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
                    if (Convert.ToDecimal(strVoucherNo) != SpPaymentMaster.PaymentMasterMax(decPaymentVoucherTypeId) + 1)
                    {
                        strVoucherNo = SpPaymentMaster.PaymentMasterMax(decPaymentVoucherTypeId).ToString();
                        strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
                        if (SpPaymentMaster.PaymentMasterMax(decPaymentVoucherTypeId) == 0)
                        {
                            strVoucherNo = "0";
                            strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
                        }
                    }
                    SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                    infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decPaymentVoucherTypeId, dtpDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                    txtVoucherNo.Text = strInvoiceNo;
                    txtVoucherNo.ReadOnly = true;
                }
                else
                {
                    txtVoucherNo.Text = string.Empty;
                    txtVoucherNo.ReadOnly = false;
                }
                dtpDate.MinDate = PublicVariables._dtFromDate;
                dtpDate.MaxDate = PublicVariables._dtToDate;
                dtpDate.Value = PublicVariables._dtCurrentDate;
                cmbBankorCash.SelectedIndex = -1;
                txtNarration.Text = string.Empty;
                txtTotal.Text = string.Empty;
                dgvPaymentVoucher.ClearSelection();
                dgvPaymentVoucher.Rows.Clear();
                btnSave.Text = "Save";
                btnDelete.Enabled = false;
                cbxPrintafterSave.Checked = false;
                dtblPartyBalance.Clear();
                if (isAutomatic)
                {
                    txtDate.Select();
                }
                else
                {
                    txtVoucherNo.Select();
                }
                PrintCheck();

            }
            catch (Exception ex)
            {
                MessageBox.Show("PV9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#13
0
        /// <summary>
        /// Function to clear the fields
        /// </summary>
        public void clear()
        {
            try
            {
                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                JournalMasterSP spMaster = new JournalMasterSP();


                //-----------------------------------VoucherNo automatic generation-------------------------------------------//

                if (strVoucherNo == string.Empty)
                {

                    strVoucherNo = "0"; //strMax;
                }
                strVoucherNo = obj.VoucherNumberAutomaicGeneration(decJournalVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);

                if (Convert.ToDecimal(strVoucherNo) != spMaster.JournalMasterGetMaxPlusOne(decJournalVoucherTypeId))
                {
                    strVoucherNo = spMaster.JournalMasterGetMax(decJournalVoucherTypeId).ToString();
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(decJournalVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                    if (spMaster.JournalMasterGetMax(decJournalVoucherTypeId).ToString() == "0")
                    {
                        strVoucherNo = "0";
                        strVoucherNo = obj.VoucherNumberAutomaicGeneration(decJournalVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                    }
                }

                //===================================================================================================================//
                if (isAutomatic)
                {
                    SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();

                    infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decJournalVoucherTypeId, dtpVoucherDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                    txtVoucherNo.Text = strInvoiceNo;
                    txtVoucherNo.ReadOnly = true;
                }
                else
                {
                    txtVoucherNo.ReadOnly = false;
                    txtVoucherNo.Text = string.Empty;
                    strInvoiceNo = txtVoucherNo.Text.Trim();
                }


                dgvJournalVoucher.Rows.Clear();
                VoucherDate();
                dtpVoucherDate.Text = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy");
                txtDebitTotal.Text = string.Empty;
                txtCreditTotal.Text = string.Empty;
                txtNarration.Text = string.Empty;
                btnSave.Text = "Save";
                btnDelete.Enabled = false;
                isEditMode = false;
                dtblPartyBalance.Clear();//to clear party balance entries to clear the dgvpatybalance
                PrintCheck();
                if (!txtVoucherNo.ReadOnly)
                {
                    txtVoucherNo.Focus();
                }
                else
                {
                    txtDate.Select();
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("JV2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
示例#14
0
 /// <summary>
 /// Function to generate Voucher number as per settings
 /// </summary>
 public void VoucherNumberGeneration()
 {
     SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
     TransactionsGeneralFill TransactionGenerateFillObj = new TransactionsGeneralFill();
     DeliveryNoteMasterSP spDeliveryNoteMaster = new DeliveryNoteMasterSP();
     string tableName = "DeliveryNoteMaster";
     string strPrefix = string.Empty;
     string strSuffix = string.Empty;
     try
     {
         strVoucherNo = "0";
         if (strVoucherNo == string.Empty)
         {
             strVoucherNo = "0";
         }
         strVoucherNo = TransactionGenerateFillObj.VoucherNumberAutomaicGeneration(decDeliveryNoteVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
         if (Convert.ToDecimal(strVoucherNo) != spDeliveryNoteMaster.DeliveryNoteMasterGetMaxPlusOne(decDeliveryNoteVoucherTypeId))
         {
             strVoucherNo = spDeliveryNoteMaster.DeliveryNoteMasterMax1(decDeliveryNoteVoucherTypeId).ToString();
             strVoucherNo = TransactionGenerateFillObj.VoucherNumberAutomaicGeneration(decDeliveryNoteVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             if (spDeliveryNoteMaster.DeliveryNoteMasterMax1(decDeliveryNoteVoucherTypeId) == "0")
             {
                 strVoucherNo = "0";
                 strVoucherNo = TransactionGenerateFillObj.VoucherNumberAutomaicGeneration(decDeliveryNoteVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             }
         }
         if (isAutomatic)
         {
             infoSuffixPrefix = new SuffixPrefixSP().GetSuffixPrefixDetails(decDeliveryNoteVoucherTypeId, dtpDate.Value);
             strPrefix = infoSuffixPrefix.Prefix;
             strSuffix = infoSuffixPrefix.Suffix;
             decDeliveryNoteSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
             strDeliveryNoteNo = strPrefix + strVoucherNo + strSuffix;
             txtDeliveryNoteNo.Text = strDeliveryNoteNo;
             txtDeliveryNoteNo.ReadOnly = true;
         }
         else
         {
             txtDeliveryNoteNo.Text = string.Empty;
             strDeliveryNoteNo = txtDeliveryNoteNo.Text.Trim();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("DN09:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Edit function
 /// </summary>
 public void EditFunction()
 {
     try
     {
         SuffixPrefixSP spSuffixPrefix = new SuffixPrefixSP();
         SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
         infoSuffixPrefix.FromDate = Convert.ToDateTime(txtFromDate.Text.ToString());
         infoSuffixPrefix.ToDate = Convert.ToDateTime(txtToDate.Text.ToString());
         String strvouchertype = (cmbVoucherType.SelectedValue.ToString());
         infoSuffixPrefix.VoucherTypeId = Convert.ToDecimal(strvouchertype.ToString());
         infoSuffixPrefix.Prefix = txtPrefix.Text.Trim();
         infoSuffixPrefix.Suffix = txtSufix.Text.Trim();
         infoSuffixPrefix.StartIndex = Convert.ToDecimal(txtStartIndex.Text.ToString());
         if (cbxPrefillWithZero.Checked)
         {
             infoSuffixPrefix.PrefillWithZero = true;
             infoSuffixPrefix.WidthOfNumericalPart = Convert.ToInt32(txtWidthofNumericalPart.Text.ToString());
         }
         else
         {
             infoSuffixPrefix.PrefillWithZero = false;
             infoSuffixPrefix.WidthOfNumericalPart = 0;
         }
         infoSuffixPrefix.Narration = txtNarration.Text.Trim();
         infoSuffixPrefix.Extra1 = string.Empty;
         infoSuffixPrefix.Extra2 = string.Empty;
         infoSuffixPrefix.SuffixprefixId = decSuffixPrefixId;
         if (spSuffixPrefix.SuffixPrefixCheckExistenceForAdd(txtFromDate.Text.ToString(), txtToDate.Text.ToString(), Convert.ToDecimal(cmbVoucherType.SelectedValue.ToString()), decSuffixPrefixId) == false)
         {
             if (spSuffixPrefix.SuffixPrefixSettingsEdit(infoSuffixPrefix))
             {
                 Messages.UpdatedMessage();
                 Clear();
             }
             else
             {
                 Messages.ReferenceExistsMessageForUpdate();
                 cmbVoucherType.Focus();
             }
         }
         else
         {
             Messages.InformationMessage("Voucher type already exist for  dates");
             cmbVoucherType.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPS5" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#16
0
 /// <summary>
 /// Function to call this form from VoucherType Selection form
 /// </summary>
 /// <param name="decVoucherTypeId"></param>
 /// <param name="strVoucherTypeName"></param>
 public void CallFromVoucherTypeSelection(decimal decVoucherTypeId, string strVoucherTypeName)
 {
     try
     {
         decsalesQuotationTypeId = decVoucherTypeId;
         VoucherTypeSP SPVoucherType = new VoucherTypeSP();
         isAutomatic = SPVoucherType.CheckMethodOfVoucherNumbering(decsalesQuotationTypeId);
         SuffixPrefixSP SPSuffixPrefix = new SuffixPrefixSP();
         SuffixPrefixInfo InfoSuffixPrefix = new SuffixPrefixInfo();
         InfoSuffixPrefix = SPSuffixPrefix.GetSuffixPrefixDetails(decsalesQuotationTypeId, dtpSalesQuotationDate.Value);
         decSalesQuotationPreffixSuffixId = InfoSuffixPrefix.SuffixprefixId;
         this.Text = strVoucherTypeName;
         base.Show();
         if (isAutomatic)
         {
             txtSalesQuotationDate.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SQ:14" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#17
0
        /// <summary>
        /// Function to call this form from VoucherType Selection form
        /// </summary>
        /// <param name="decVoucherTypeId"></param>
        /// <param name="strVoucherTypeName"></param>
        public void CallFromVoucherTypeSelection(decimal decVoucherTypeId, string strVoucherTypeName)
        {
            string strSuffix = string.Empty;
            string strPrefix = string.Empty;
            try
            {
                decRejectionInVoucherTypeId = decVoucherTypeId;
                VoucherTypeSP spVoucherType = new VoucherTypeSP();
                isAutomatic = spVoucherType.CheckMethodOfVoucherNumbering(decRejectionInVoucherTypeId);
                SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                SuffixPrefixInfo InfoSuffixPrefix = new SuffixPrefixInfo();
                InfoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decRejectionInVoucherTypeId, dtpDate.Value);
                decRejectionInSuffixPrefixId = InfoSuffixPrefix.SuffixprefixId;
                strSuffix = InfoSuffixPrefix.Suffix;
                strPrefix = InfoSuffixPrefix.Prefix;
                this.Text = strVoucherTypeName;
                base.Show();

                if (isAutomatic)
                {
                    ClearRejectionIn();
                    VoucherNoGeneration();
                    txtDate.Focus();
                    txtRejectionInNo.ReadOnly = true;
                }
                else
                {
                    txtRejectionInNo.Focus();
                    txtRejectionInNo.ReadOnly = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("RI:30" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#18
0
 /// <summary>
 /// Function to use the voucherno Automatic generation
 /// </summary>
 public void VoucherNumberGeneration()
 {
     string strTableName = "SalesOrderMaster";
     string strPrefix = string.Empty;
     string strSuffix = string.Empty;
     string strInvoiceNo = string.Empty;
     try
     {
         SalesOrderMasterSP spSalesOrderMaster = new SalesOrderMasterSP();
         TransactionsGeneralFill TransactionGeneralFillObj = new TransactionsGeneralFill();
         if (isAutomatic)
         {
             strVoucherNo = "0";
             if (strVoucherNo == string.Empty)
             {
                 strVoucherNo = "0"; //strMax;
             }
             strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decSalesOrderTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, strTableName);
             if (Convert.ToDecimal(strVoucherNo) != spSalesOrderMaster.SalesOrderVoucherMasterMaxPlusOne(decSalesOrderTypeId))
             {
                 strVoucherNo = spSalesOrderMaster.SalesOrderVoucherMasterMax(decSalesOrderTypeId).ToString();
                 strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decSalesOrderTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, strTableName);
                 if (spSalesOrderMaster.SalesOrderVoucherMasterMax(decSalesOrderTypeId).ToString() == "0")
                 {
                     strVoucherNo = "0";
                     strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decSalesOrderTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, strTableName);
                 }
             }
             if (isAutomatic)
             {
                 SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                 SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                 infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decSalesOrderTypeId, dtpDate.Value);
                 strPrefix = infoSuffixPrefix.Prefix;
                 strSuffix = infoSuffixPrefix.Suffix;
                 strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                 txtOrderNo.Text = strInvoiceNo;
                 txtOrderNo.ReadOnly = true;
             }
             else
             {
                 txtOrderNo.ReadOnly = false;
                 txtOrderNo.Text = string.Empty;
                 strInvoiceNo = txtOrderNo.Text.Trim();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SO40:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#19
0
        /// <summary>
        /// Clear function and voucherno generation based on settings
        /// </summary>
        public void Clear()
        {
            try
            {
                PurchaseOrderMasterSP spPurchaseOrderMaster = new PurchaseOrderMasterSP();
                SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                SettingsSP spSettings = new SettingsSP();
                if (isAutomatic)
                {
                    strVoucherNo = spPurchaseOrderMaster.PurchaseOrderVoucherMasterMax(decPurchaseOrderTypeId).ToString();
                    if (strVoucherNo == string.Empty)
                    {
                        strVoucherNo = "0";
                    }
                    strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPurchaseOrderTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
                    if (strVoucherNo != spPurchaseOrderMaster.PurchaseOrderVoucherMasterMax(decPurchaseOrderTypeId).ToString())
                    {
                        strVoucherNo = spPurchaseOrderMaster.PurchaseOrderVoucherMasterMax(decPurchaseOrderTypeId).ToString();
                        strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPurchaseOrderTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
                        if (spPurchaseOrderMaster.PurchaseOrderVoucherMasterMax(decPurchaseOrderTypeId) == "0")
                        {
                            strVoucherNo = "0";
                            strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPurchaseOrderTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
                        }
                    }
                    infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decPurchaseOrderTypeId, dtpDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    decPurchaseSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
                    strOrderNo = strPrefix + strVoucherNo + strSuffix;
                    txtOrderNo.Text = strOrderNo;
                    txtOrderNo.ReadOnly = true;
                    txtDate.Focus();
                }
                else
                {
                    txtOrderNo.Text = string.Empty;
                    txtOrderNo.ReadOnly = false;
                    txtOrderNo.Focus();
                }
                dtpDate.Value = PublicVariables._dtCurrentDate;
                dtpDate.MinDate = PublicVariables._dtFromDate;
                dtpDate.MaxDate = PublicVariables._dtToDate;
                dtpDueDate.Value = PublicVariables._dtCurrentDate;
                this.txtDueDate.Text = this.dtpDueDate.Value.ToString("dd-MMM-yyyy");
                dtpDueDate.MinDate = PublicVariables._dtFromDate;
                dtpDueDate.MaxDate = PublicVariables._dtToDate;
                txtDueDays.Text = "0";
                CashOrPartyComboFill();
                if (!ShowProductCode())
                {
                    this.dgvPurchaseOrder.Columns["dgvtxtProductCode"].Visible = false;
                }
                if (!ShowBarcode())
                {
                    this.dgvPurchaseOrder.Columns["dgvtxtBarcode"].Visible = false;
                }
                if (spSettings.SettingsStatusCheck("ShowUnit") == "Yes")
                {
                    dgvPurchaseOrder.Columns["dgvcmbUnit"].Visible = true;
                }
                else
                {
                    dgvPurchaseOrder.Columns["dgvcmbUnit"].Visible = false;
                }
                if (PrintAfetrSave())
                {
                    cbxPrintAfterSave.Checked = true;
                }
                else
                {
                    cbxPrintAfterSave.Checked = false;
                }
                txtNarration.Text = string.Empty;

                btnSave.Text = "Save";
                btnDelete.Enabled = false;
                cbxCancel.Enabled = true;
                cbxCancel.Checked = false;
                dgvPurchaseOrder.Rows.Clear();
                txtTotalAmount.Text = string.Empty;
            }
            catch (Exception ex)
            {
                MessageBox.Show("PO28:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#20
0
 /// <summary>
 /// Function to call this form from VoucherType Selection form
 /// </summary>
 /// <param name="strVoucherTypeId"></param>
 /// <param name="strVoucherTypeName"></param>
 public void CallFromVoucherTypeSelection(decimal strVoucherTypeId, string strVoucherTypeName)
 {
     try
     {
         strPaymentVoucherTypeId = strVoucherTypeId.ToString();
         decPaymentVoucherTypeId = strVoucherTypeId;
         VoucherTypeSP spvouchertype = new VoucherTypeSP();
         isAutomatic = spvouchertype.CheckMethodOfVoucherNumbering(Convert.ToDecimal(strVoucherTypeId.ToString()));
         SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
         SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
         infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(Convert.ToDecimal(strPaymentVoucherTypeId), dtpDate.Value);
         decPaymentSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
         this.Text = strVoucherTypeName;
         base.Show();
         if (isAutomatic)
         {
             txtDate.Focus();
         }
         else
         {
             txtAdvanceVoucherNo.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("AP11:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#21
0
 /// <summary>
 /// Function to generate Voucher number as per settings
 /// </summary>
 public void VoucherNoGeneration()
 {
     TransactionsGeneralFill obj = new TransactionsGeneralFill();
     AdvancePaymentSP spAdvancePayment = new AdvancePaymentSP();
     if (strVoucherNo == string.Empty)
     {
         strVoucherNo = "0";
     }
     strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpSalaryMonth.Value, strAdvancePayment);
     if (Convert.ToDecimal(strVoucherNo) != spAdvancePayment.AdvancePaymentGetMaxPlusOne(decPaymentVoucherTypeId))
     {
         strVoucherNo = spAdvancePayment.AdvancePaymentGetMax(decPaymentVoucherTypeId).ToString();
         strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpSalaryMonth.Value, strAdvancePayment);
         if (spAdvancePayment.AdvancePaymentGetMax(decPaymentVoucherTypeId) == "0")
         {
             strVoucherNo = "0";
             strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPaymentVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpSalaryMonth.Value, strAdvancePayment);
         }
     }
     if (isAutomatic)
     {
         SuffixPrefixSP spSuffixPrefix = new SuffixPrefixSP();
         SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
         infoSuffixPrefix = spSuffixPrefix.GetSuffixPrefixDetails(decPaymentVoucherTypeId, dtpDate.Value);
         strPrefix = infoSuffixPrefix.Prefix;
         strSuffix = infoSuffixPrefix.Suffix;
         strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
         txtAdvanceVoucherNo.Text = strInvoiceNo;
         txtAdvanceVoucherNo.Enabled = false;
     }
 }
示例#22
0
 /// <summary>
 /// Function to reset the form to create new sales quatation
 /// </summary>
 public void Clear()
 {
     TransactionsGeneralFill transactionGeneralFillObj = new TransactionsGeneralFill();
     SalesQuotationMasterSP SpSalesQuotationMaster = new SalesQuotationMasterSP();
     try
     {
         if (isAutomatic)
         {
             strSalesQuotationNo = SpSalesQuotationMaster.SalesQuotationMasterGetMax(decsalesQuotationTypeId).ToString();
             if (strSalesQuotationNo == string.Empty)
             {
                 strSalesQuotationNo = " 0";
             }
             strSalesQuotationNo = transactionGeneralFillObj.VoucherNumberAutomaicGeneration(decsalesQuotationTypeId, Convert.ToDecimal(strSalesQuotationNo), dtpSalesQuotationDate.Value, tableName);
             if (Convert.ToDecimal(strSalesQuotationNo) != SpSalesQuotationMaster.SalesQuotationMaxGetPlusOne(decsalesQuotationTypeId))
             {
                 strSalesQuotationNo = Convert.ToString(SpSalesQuotationMaster.SalesQuotationMaxGetPlusOne(decsalesQuotationTypeId));
                 strSalesQuotationNo = transactionGeneralFillObj.VoucherNumberAutomaicGeneration(decsalesQuotationTypeId, Convert.ToDecimal(strSalesQuotationNo), dtpSalesQuotationDate.Value, tableName);
                 if (SpSalesQuotationMaster.SalesQuotationMasterGetMax(decsalesQuotationTypeId) == "0")
                 {
                     strSalesQuotationNo = "0";
                     strSalesQuotationNo = transactionGeneralFillObj.VoucherNumberAutomaicGeneration(decsalesQuotationTypeId, Convert.ToDecimal(strSalesQuotationNo), dtpSalesQuotationDate.Value, tableName);
                 }
             }
             if (isAutomatic)
             {
                 SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                 SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                 infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decsalesQuotationTypeId, dtpSalesQuotationDate.Value);
                 strPrefix = infoSuffixPrefix.Prefix;
                 strSuffix = infoSuffixPrefix.Suffix;
                 decSalesQuotationPreffixSuffixId = infoSuffixPrefix.SuffixprefixId;
                 strInvoiceNo = strPrefix + strSalesQuotationNo + strSuffix;
                 txtQuotationNo.Text = strInvoiceNo;
                 txtQuotationNo.ReadOnly = true;
             }
         }
         else
         {
             txtQuotationNo.Text = string.Empty;
         }
         salesQuotationDatefill();
         if (!ShowProductCode())
         {
             this.dgvProduct.Columns["dgvtxtProductCode"].Visible = false;
         }
         if (!ShowBarcode())
         {
             this.dgvProduct.Columns["dgvtxtBarcode"].Visible = false;
         }
         if (PrintAfetrSave())
         {
             cbxPrintAfterSave.Checked = true;
         }
         else
         {
             cbxPrintAfterSave.Checked = false;
         }
         dgvProduct.Rows.Clear();
         txtNarration.Text = string.Empty;
         txtTotal.Text = string.Empty;
         btnSave.Text = "Save";
         btnDelete.Enabled = false;
         cbxApproved.Checked = false;
         ComboCurrencyFill();
         ComboPricingLevelFill();
         ComboSalesManFill();
         CashOrPartyCombofill();
         FillProducts(false, null);
     }
     catch (Exception ex)
     {
         MessageBox.Show("SQ:31" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#23
0
        /// <summary>
        /// Voucher no automatic generation, it considered the settings also
        /// </summary>
        public void VoucherNumberGeneration()
        {
            try
            {
                TransactionsGeneralFill obj = new TransactionsGeneralFill();

                PDCClearanceMasterSP spPdclearance = new PDCClearanceMasterSP();

                if (strVoucherNo == string.Empty)
                {
                    strVoucherNo = "0";
                }
                strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPDCclearanceVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, strtableName);
                if (Convert.ToDecimal(strVoucherNo) != spPdclearance.PDCClearanceMaxUnderVoucherTypePlusOne(decPDCclearanceVoucherTypeId))
                {
                    strVoucherNo = spPdclearance.PDCClearanceMaxUnderVoucherType(decPDCclearanceVoucherTypeId).ToString();
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPDCclearanceVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, strtableName);
                    if (spPdclearance.PDCClearanceMaxUnderVoucherType(decPDCclearanceVoucherTypeId).ToString() == "0")
                    {
                        strVoucherNo = "0";
                        strVoucherNo = obj.VoucherNumberAutomaicGeneration(decPDCclearanceVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, strtableName);
                    }
                }
                if (isAutomatic)
                {
                    SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                    infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decPDCclearanceVoucherTypeId, dtpVoucherDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    decSufixprefixPdcpayableID = infoSuffixPrefix.SuffixprefixId;
                    strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                    txtvoucherNo.Text = strInvoiceNo;
                    lblVoucherNoManualValidator.Visible = false;
                    txtvoucherNo.ReadOnly = true;
                    txtvoucherNo.Enabled = false;
                }
                else
                {
                    txtvoucherNo.ReadOnly = false;
                    txtvoucherNo.Text = string.Empty;
                    lblVoucherNoManualValidator.Visible = true;
                    strInvoiceNo = txtvoucherNo.Text.Trim();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("PC8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 /// grid double click fill the items in controll for edit
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvSuffixPrefixSettings_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex != -1)
         {
             SuffixPrefixSP spSuffixPrefix = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix = spSuffixPrefix.SuffixPrefixView(Convert.ToDecimal(dgvSuffixPrefixSettings.Rows[e.RowIndex].Cells["dgvtxtSuffixPrefixId"].Value.ToString()));
             decSuffixPrefixId = Convert.ToDecimal(dgvSuffixPrefixSettings.Rows[e.RowIndex].Cells["dgvtxtSuffixPrefixId"].Value.ToString());
             txtFromDate.Text = infoSuffixPrefix.FromDate.ToString("dd-MMM-yyyy");
             txtToDate.Text = infoSuffixPrefix.ToDate.ToString("dd-MMM-yyyy");
             cmbVoucherType.SelectedValue = infoSuffixPrefix.VoucherTypeId.ToString();
             txtStartIndex.Text = infoSuffixPrefix.StartIndex.ToString();
             txtStartIndex.Enabled = false;
             txtSufix.Text = infoSuffixPrefix.Suffix;
             txtPrefix.Text = infoSuffixPrefix.Prefix;
             if (infoSuffixPrefix.PrefillWithZero == true)
             {
                 cbxPrefillWithZero.Checked = true;
                 txtWidthofNumericalPart.Text = infoSuffixPrefix.WidthOfNumericalPart.ToString();
             }
             else
             {
                 cbxPrefillWithZero.Checked = false;
                 txtWidthofNumericalPart.Text = infoSuffixPrefix.WidthOfNumericalPart.ToString();
             }
             txtNarration.Text = infoSuffixPrefix.Narration;
             btnSave.Text = "Update";
             btnDelete.Enabled = true;
             txtFromDate.Focus();
             txtWidthofNumericalPart.Enabled = true;
             if (cbxPrefillWithZero.Checked == true)
             {
                 txtWidthofNumericalPart.Enabled = true;
             }
             else
             {
                 txtWidthofNumericalPart.Enabled = false;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SPS20" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#25
0
 /// <summary>
 /// Function to reset the form to make new service voucher
 /// </summary>
 public void Clear()
 {
     try
     {
         /*Automatic invoice number generation*/
         TransactionsGeneralFill obj = new TransactionsGeneralFill();
         VoucherDate();
         if (isAutomatic)    //  Checking voucher number generation is automatic or not
         {
             ServiceMasterSP spServiceMaster = new ServiceMasterSP();
             ContraMasterSP spContraMaster = new ContraMasterSP();
             if (strVoucherNo == string.Empty)
             {
                 strVoucherNo = "0";
             }
             strVoucherNo = obj.VoucherNumberAutomaicGeneration(DecServicetVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
             if (Convert.ToDecimal(strVoucherNo) != (spServiceMaster.ServiceMasterGetMax(DecServicetVoucherTypeId)) + 1)
             {
                 strVoucherNo = spServiceMaster.ServiceMasterGetMax(DecServicetVoucherTypeId).ToString();
                 strVoucherNo = obj.VoucherNumberAutomaicGeneration(DecServicetVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                 if (spServiceMaster.ServiceMasterGetMax(DecServicetVoucherTypeId) == 0)
                 {
                     strVoucherNo = "0";
                     strVoucherNo = obj.VoucherNumberAutomaicGeneration(DecServicetVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                 }
             }
             SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(DecServicetVoucherTypeId, dtpVoucherDate.Value);   //  Getting suffix-prefix settings
             strPrefix = infoSuffixPrefix.Prefix;
             strSuffix = infoSuffixPrefix.Suffix;
             decServiceSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
             strInvoiceNo = strPrefix + strVoucherNo + strSuffix;    // Generating invoice number with suffix and prefix
             txtInvoiceNumber.Text = strInvoiceNo;
             txtInvoiceNumber.ReadOnly = true;
             txtVoucherDate.Select();
         }
         else
         {
             txtInvoiceNumber.Text = string.Empty;
             txtInvoiceNumber.ReadOnly = false;
         }
         ServiceAcoountComboFill();
         GridParticularComboFill();
         SalesmanComboFill();
         CashOrPartyComboFill();
         isEditMode = false;
         txtDiscount.Text = "0";
         txtTotalAmount.Text = "0";
         txtGrandTotal.Text = "0";
         txtCreditPeriod.Text = "0";
         txtCustomer.Text = string.Empty;
         txtNarration.Text = string.Empty;
         PrintCheck();
         int inCount = dgvServiceVoucher.RowCount;
         for (int i = 0; i < inCount; i++)
         {
             dgvServiceVoucher.Rows[i].Cells["dgvcmbParticulars"].Value = null;
             dgvServiceVoucher.Rows[i].Cells["dgvtxtMeasure"].Value = null;
             dgvServiceVoucher.Rows[i].Cells["dgvtxtAmount"].Value = null;
         }
         dgvServiceVoucher.ClearSelection();
         btnDelete.Enabled = false;
         btnSave.Text = "Save";
         dgvServiceVoucher.Rows.Clear();
     }
     catch (Exception ex)
     {
         MessageBox.Show("SV 04 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#26
0
 /// <summary>
 /// Cleare function and Generate the voucher no based on settings
 /// </summary>
 public void Clear()
 {
     try
     {
         TransactionsGeneralFill obj = new TransactionsGeneralFill();
         SalesMasterSP spSalesMaster = new SalesMasterSP();
         if (isAutomatic)
         {
             if (strVoucherNo == string.Empty)
             {
                 strVoucherNo = "0";
             }
             strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(DecSalesInvoiceVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, "SalesMaster");
             if (Convert.ToDecimal(strVoucherNo) != (spSalesMaster.SalesMasterVoucherMax(DecSalesInvoiceVoucherTypeId)))
             {
                 strVoucherNo = spSalesMaster.SalesMasterVoucherMax(DecSalesInvoiceVoucherTypeId).ToString();
                 strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(DecSalesInvoiceVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, "SalesMaster");
                 if (spSalesMaster.SalesMasterVoucherMax(DecSalesInvoiceVoucherTypeId) == 0)
                 {
                     strVoucherNo = "0";
                     strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(DecSalesInvoiceVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, "SalesMaster");
                 }
             }
             SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(DecSalesInvoiceVoucherTypeId, dtpDate.Value);
             strPrefix = infoSuffixPrefix.Prefix;
             strSuffix = infoSuffixPrefix.Suffix;
             strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
             txtInvoiceNo.Text = strInvoiceNo;
             txtInvoiceNo.ReadOnly = true;
             decSalseInvoiceSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
         }
         else
         {
             txtInvoiceNo.ReadOnly = false;
             txtInvoiceNo.Text = string.Empty;
             strVoucherNo = string.Empty;
             strInvoiceNo = strVoucherNo;
         }
         if (PrintAfetrSave())
         {
             cbxPrintAfterSave.Checked = true;
         }
         else
         {
             cbxPrintAfterSave.Checked = false;
         }
         cmbPricingLevel.SelectedIndex = 0;
         cmbSalesAccount.SelectedIndex = 0;
         cmbCashOrParty.SelectedIndex = 0;
         cmbSalesMan.SelectedIndex = 0;
         cmbSalesMode.SelectedIndex = 0;
         cmbDrorCr.SelectedIndex = 0;
         cmbCashOrbank.SelectedIndex = 0;
         cmbCurrency.Enabled = true;
         txtCustomer.Text = cmbCashOrParty.Text;
         txtTransportCompany.Text = string.Empty;
         txtVehicleNo.Text = string.Empty;
         txtNarration.Text = string.Empty;
         txtCreditPeriod.Text = "0";
         txtTotalAmount.Text = "0.00";
         txtBillDiscount.Text = "0";
         txtGrandTotal.Text = "0.00";
         lblTaxTotalAmount.Text = "0.00";
         lblLedgerTotalAmount.Text = "0.00";
         btnSave.Text = "Save";
         btnDelete.Enabled = false;
         dtpDate.MinDate = PublicVariables._dtFromDate;
         dtpDate.MaxDate = PublicVariables._dtToDate;
         dtpDate.Value = PublicVariables._dtCurrentDate;
         txtDate.Text = dtpDate.Value.ToString("dd-MMM-yyyy");
         dgvSalesInvoiceLedger.Rows.Clear();
         isFromEditMode = false;
         if (dgvSalesInvoice.DataSource != null)
         {
             ((DataTable)dgvSalesInvoice.DataSource).Rows.Clear();
         }
         else
         {
             dgvSalesInvoice.Rows.Clear();
         }
         gridCombofill();
         if (dgvSalesInvoiceTax.DataSource != null)
         {
             ((DataTable)dgvSalesInvoiceTax.DataSource).Rows.Clear();
         }
         else
         {
             dgvSalesInvoiceTax.Rows.Clear();
         }
         taxGridFill();
         if (!txtInvoiceNo.ReadOnly)
         {
             txtInvoiceNo.Focus();
         }
         else
         {
             txtDate.Select();
         }
         
         txtTotalAmount.Text = "0.00";
         txtGrandTotal.Text = "0.00";
         lblTotalQuantitydisplay.Text = "0";
     }
     catch (Exception ex)
     {
         MessageBox.Show("SI : 01" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#27
0
 /// <summary>
 /// Function to call this form from VoucherType Selection form
 /// </summary>
 /// <param name="decServiceVoucherTypeId"></param>
 /// <param name="strServiceVoucherTypeName"></param>
 public void CallFromVoucherTypeSelection(decimal decServiceVoucherTypeId, string strServiceVoucherTypeName) //  Invoked from frmVoucherTypeSelection form
 {
     try
     {
         DecServicetVoucherTypeId = decServiceVoucherTypeId;
         VoucherTypeSP spVoucherType = new VoucherTypeSP();
         isAutomatic = spVoucherType.CheckMethodOfVoucherNumbering(DecServicetVoucherTypeId);    //  Checking voucher number is automatic or not
         SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
         SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
         infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(DecServicetVoucherTypeId, dtpVoucherDate.Value);
         decServiceSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
         strPrefix = infoSuffixPrefix.Prefix;
         strSuffix = infoSuffixPrefix.Suffix;
         this.Text = strServiceVoucherTypeName;
         base.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show("SV 13 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#28
0
        /// <summary>
        /// It is a function for vouchertypeselection form to select perticular voucher and open the form under the vouchertype
        /// </summary>
        /// <param name="decVoucherTypeId"></param>
        /// <param name="strVoucherTypeName"></param>
        public void CallFromVoucherTypeSelection(decimal decVoucherTypeId, string strVoucherTypeName)
        {
            try
            {
                decJournalVoucherTypeId = decVoucherTypeId;
                VoucherTypeSP spVoucherType = new VoucherTypeSP();
                isAutomatic = spVoucherType.CheckMethodOfVoucherNumbering(decJournalVoucherTypeId);
                SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();

                infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decJournalVoucherTypeId, dtpVoucherDate.Value);
                decJournalSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
                strPrefix = infoSuffixPrefix.Prefix;
                strSuffix = infoSuffixPrefix.Suffix;
                this.Text = strVoucherTypeName;
                base.Show();
                clear();
            }
            catch (Exception ex)
            {
                MessageBox.Show("JV1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
示例#29
0
 /// <summary>
 /// Voucher no generation function based on settings
 /// </summary>
 public void VoucherNumberGeneration()
 {
     try
     {
         PhysicalStockMasterSP spPhysicalStockMaster = new PhysicalStockMasterSP();
         if (strVoucherNo == string.Empty)
         {
             strVoucherNo = "0";
         }
         strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPhysicalStockVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, strTableName);
         if (Convert.ToDecimal(strVoucherNo) != (spPhysicalStockMaster.PhysicalStockMasterVoucherMax(decPhysicalStockVoucherTypeId)))
         {
             strVoucherNo = spPhysicalStockMaster.PhysicalStockMasterVoucherMax(decPhysicalStockVoucherTypeId).ToString();
             strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPhysicalStockVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, strTableName);
             if (spPhysicalStockMaster.PhysicalStockMasterVoucherMax(decPhysicalStockVoucherTypeId) == 0)
             {
                 strVoucherNo = "0";
                 strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPhysicalStockVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, strTableName);
             }
         }
         if (isAutomatic)
         {
             SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decPhysicalStockVoucherTypeId, dtpDate.Value);
             strPrefix = infoSuffixPrefix.Prefix;
             strSuffix = infoSuffixPrefix.Suffix;
             decPhysicalStockSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
             txtVoucherNo.Text = strPrefix + strVoucherNo + strSuffix;
             txtVoucherNo.ReadOnly = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PS:18" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#30
0
 /// <summary>
 /// Function to call this form from VoucherType Selection form
 /// </summary>
 /// <param name="decPaymentVoucherTypeId1"></param>
 /// <param name="strVoucherTypeNames1"></param>
 public void CallFromVoucherTypeSelection(decimal decPaymentVoucherTypeId1, string strVoucherTypeNames1)
 {
     try
     {
         decPaymentVoucherTypeId = decPaymentVoucherTypeId1;
         VoucherTypeSP spVoucherType = new VoucherTypeSP();
         isAutomatic = spVoucherType.CheckMethodOfVoucherNumbering(decPaymentVoucherTypeId);
         SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
         SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
         infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decPaymentVoucherTypeId, dtpDate.Value);
         decDailySuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
         strPrefix = infoSuffixPrefix.Prefix;
         strSuffix = infoSuffixPrefix.Suffix;
         base.Show();
         Clear();
     }
     catch (Exception ex)
     {
         MessageBox.Show("PV13:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#31
0
 /// <summary>
 /// For VoucherNumberGeneration
 /// </summary>
 public void VoucherNumberGeneration()
 {
     try
     {
         TransactionsGeneralFill obj = new TransactionsGeneralFill();
         RejectionOutMasterSP spRejectionOut = new RejectionOutMasterSP();
         strVoucherNo = "0";
         if (strVoucherNo == string.Empty)
         {
             strVoucherNo = "0";
         }
         strVoucherNo = obj.VoucherNumberAutomaicGeneration(decRejectionOutVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
         if (Convert.ToDecimal(strVoucherNo) != spRejectionOut.RejectionOutMasterGetMaxPlusOne(decRejectionOutVoucherTypeId))
         {
             strVoucherNo = spRejectionOut.RejectionOutMasterGetMax(decRejectionOutVoucherTypeId).ToString();
             strVoucherNo = obj.VoucherNumberAutomaicGeneration(decRejectionOutVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             if (spRejectionOut.RejectionOutMasterGetMax(decRejectionOutVoucherTypeId) == "0")
             {
                 strVoucherNo = "0";
                 strVoucherNo = obj.VoucherNumberAutomaicGeneration(decRejectionOutVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             }
         }
         if (isAutomatic)
         {
             SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decRejectionOutVoucherTypeId, dtpDate.Value);
             strPrefix = infoSuffixPrefix.Prefix;
             strSuffix = infoSuffixPrefix.Suffix;
             decRejectionOutSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
             strRejectionOutNo = strPrefix + strVoucherNo + strSuffix;
             txtRejectionOutNo.Text = strRejectionOutNo;
             txtRejectionOutNo.ReadOnly = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("RO02:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// Function to generate the voucher number as per settings
        /// </summary>
        public void voucherNumberGeneration()
        {
            try
            {
                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                SalaryVoucherMasterSP spMaster = new SalaryVoucherMasterSP();
                //-----------------------------------------Voucher number Automatic generation ------------------------------------------------//
                if (strVoucherNo == string.Empty)
                {

                   strVoucherNo = "0"; 
                }
                strVoucherNo = obj.VoucherNumberAutomaicGeneration(decMonthlyVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                if (Convert.ToDecimal(strVoucherNo) != spMaster.SalaryVoucherMasterGetMaxPlusOne(decMonthlyVoucherTypeId))
                {
                    strVoucherNo = spMaster.SalaryVoucherMasterGetMax(decMonthlyVoucherTypeId).ToString();
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(decMonthlyVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                    if (spMaster.SalaryVoucherMasterGetMax(decMonthlyVoucherTypeId) == "0")
                    {
                        strVoucherNo = "0";
                        strVoucherNo = obj.VoucherNumberAutomaicGeneration(decMonthlyVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpVoucherDate.Value, tableName);
                    }
                }
                if (isAutomatic)
                {
                    SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();

                    infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decMonthlyVoucherTypeId, dtpVoucherDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                    txtVoucherNo.Text = strInvoiceNo;
                    txtVoucherNo.ReadOnly = true;
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("MSV14:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

        }
示例#33
0
 /// <summary>
 /// Function for Voucher Number Generation
 /// </summary>
 public void VoucherNumberGeneration()
 {
     string strPrefix = string.Empty;
     string strSuffix = string.Empty;
     string tableName = "PurchaseReturnMaster";
     string strReturnNo = string.Empty;
     TransactionsGeneralFill TransactionGeneralFillObj = new TransactionsGeneralFill();
     PurchaseReturnMasterSP SPPurchaseReturnMaster = new PurchaseReturnMasterSP();
     try
     {
         if (strVoucherNo == string.Empty)
         {
             strVoucherNo = "0";
         }
         strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPurchaseReturnVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
         if (Convert.ToDecimal(strVoucherNo) != SPPurchaseReturnMaster.PurchaseReturnMasterGetMaxPlusOne(decPurchaseReturnVoucherTypeId))
         {
             strVoucherNo = SPPurchaseReturnMaster.PurchaseReturnMasterGetMax(decPurchaseReturnVoucherTypeId).ToString();
             strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPurchaseReturnVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             if (SPPurchaseReturnMaster.PurchaseReturnMasterGetMax(decPurchaseReturnVoucherTypeId) == "0")
             {
                 strVoucherNo = "0";
                 strVoucherNo = TransactionGeneralFillObj.VoucherNumberAutomaicGeneration(decPurchaseReturnVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, tableName);
             }
         }
         if (isAutomatic)
         {
             SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
             SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
             infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decPurchaseReturnVoucherTypeId, dtpDate.Value);
             strPrefix = infoSuffixPrefix.Prefix;
             strSuffix = infoSuffixPrefix.Suffix;
             decPurchaseReturnSuffixPrefixId = infoSuffixPrefix.SuffixprefixId;
             strReturnNo = strPrefix + strVoucherNo + strSuffix;
             txtReturnNo.Text = strReturnNo;
             txtReturnNo.ReadOnly = true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PR:27" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#34
0
        /// <summary>
        /// Function to clear the fields
        /// </summary>
        public void Clear()
        {
            try
            {
                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                StockJournalMasterSP spMaster = new StockJournalMasterSP();
                if (isAutomatic)
                {
                    if (strVoucherNo == string.Empty)
                    {

                        strVoucherNo = "0";
                    }
                    strVoucherNo = obj.VoucherNumberAutomaicGeneration(decVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, TableName);

                    if (Convert.ToDecimal(strVoucherNo) != spMaster.StockJournalMasterMaxPlusOne(decVoucherTypeId))
                    {
                        strVoucherNo = spMaster.StockJournalMasterMax(decVoucherTypeId).ToString();
                        strVoucherNo = obj.VoucherNumberAutomaicGeneration(decVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, TableName);
                        if (spMaster.StockJournalMasterMax(decVoucherTypeId).ToString() == "0")
                        {
                            strVoucherNo = "0";
                            strVoucherNo = obj.VoucherNumberAutomaicGeneration(decVoucherTypeId, Convert.ToDecimal(strVoucherNo), dtpDate.Value, TableName);
                        }
                    }
                    SuffixPrefixSP spSuffisprefix = new SuffixPrefixSP();
                    SuffixPrefixInfo infoSuffixPrefix = new SuffixPrefixInfo();
                    infoSuffixPrefix = spSuffisprefix.GetSuffixPrefixDetails(decVoucherTypeId, dtpDate.Value);
                    strPrefix = infoSuffixPrefix.Prefix;
                    strSuffix = infoSuffixPrefix.Suffix;
                    strInvoiceNo = strPrefix + strVoucherNo + strSuffix;
                    txtVoucherNo.Text = strInvoiceNo;
                    txtVoucherNo.ReadOnly = true;
                }
                else
                {
                    txtVoucherNo.ReadOnly = false;
                    txtVoucherNo.Text = string.Empty;
                    strInvoiceNo = txtVoucherNo.Text.Trim();
                }
                if (PrintAfetrSave())
                {
                    cbxPrintAfterSave.Checked = true;

                }
                else
                {
                    cbxPrintAfterSave.Checked = false;
                }
                btnDelete.Enabled = false;
                btnSave.Text = "Save";
                gbxTransactionType.Enabled = true;
                cmbFinishedGoods.Enabled = true;
                txtQty.Enabled = true;
                btnAdd.Enabled = true;
                VoucherDate();
                dgvConsumption.Rows.Clear();
                dgvProduction.Rows.Clear();
                dgvAdditionalCost.Rows.Clear();
                cmbFinishedGoods.Text = string.Empty;
                txtQty.Text = String.Empty;
                txtNarration.Text = string.Empty;
                //AutoCompleteProducts();
                lblAdditionalCostAmount.Text = "0.00";
                lblConsumptionAmount.Text = "0.00";
                lblProductionAmount.Text = "0.00";

            }
            catch (Exception ex)
            {
                MessageBox.Show("SJ:29" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#35
0
 /// <summary>
 /// Function to get SuffixPrefix details based on parameter
 /// </summary>
 /// <param name="vouchertypeId"></param>
 /// <param name="date"></param>
 /// <returns></returns>
 public SuffixPrefixInfo GetSuffixPrefixDetails(decimal vouchertypeId, DateTime date)
 {
     SuffixPrefixInfo suffixprefixinfo = new SuffixPrefixInfo();
     SqlDataReader sdrreader = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("GetSuffixPrefixDetails", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@voucherId", SqlDbType.Decimal);
         sprmparam.Value = vouchertypeId;
         sprmparam = sccmd.Parameters.Add("@date", SqlDbType.DateTime);
         sprmparam.Value = date;
         sdrreader = sccmd.ExecuteReader();
         while (sdrreader.Read())
         {
             suffixprefixinfo.SuffixprefixId = decimal.Parse(sdrreader[0].ToString());
             suffixprefixinfo.VoucherTypeId = decimal.Parse(sdrreader[1].ToString());
             suffixprefixinfo.FromDate = DateTime.Parse(sdrreader[2].ToString());
             suffixprefixinfo.ToDate = DateTime.Parse(sdrreader[3].ToString());
             suffixprefixinfo.StartIndex = decimal.Parse(sdrreader[4].ToString());
             suffixprefixinfo.Prefix = sdrreader[5].ToString();
             suffixprefixinfo.Suffix = sdrreader[6].ToString();
             suffixprefixinfo.WidthOfNumericalPart = int.Parse(sdrreader[7].ToString());
             suffixprefixinfo.PrefillWithZero = bool.Parse(sdrreader[8].ToString());
             suffixprefixinfo.Narration = sdrreader[9].ToString();
             suffixprefixinfo.ExtraDate = DateTime.Parse(sdrreader[10].ToString());
             suffixprefixinfo.Extra1 = sdrreader[11].ToString();
             suffixprefixinfo.Extra2 = sdrreader[12].ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sdrreader.Close();
         sqlcon.Close();
     }
     return suffixprefixinfo;
 }