Exemple #1
0
 public void RejectionOutMasterEdit(RejectionOutMasterInfo rejectionoutmasterinfo)
 {
     try
     {
         if (base.sqlcon.State == ConnectionState.Closed)
         {
             base.sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("RejectionOutMasterEdit", base.sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam19 = new SqlParameter();
         sprmparam19       = sccmd.Parameters.Add("@rejectionOutMasterId", SqlDbType.Decimal);
         sprmparam19.Value = rejectionoutmasterinfo.RejectionOutMasterId;
         sprmparam19       = sccmd.Parameters.Add("@voucherNo", SqlDbType.VarChar);
         sprmparam19.Value = rejectionoutmasterinfo.VoucherNo;
         sprmparam19       = sccmd.Parameters.Add("@invoiceNo", SqlDbType.VarChar);
         sprmparam19.Value = rejectionoutmasterinfo.InvoiceNo;
         sprmparam19       = sccmd.Parameters.Add("@suffixPrefixId", SqlDbType.Decimal);
         sprmparam19.Value = rejectionoutmasterinfo.SuffixPrefixId;
         sprmparam19       = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
         sprmparam19.Value = rejectionoutmasterinfo.VoucherTypeId;
         sprmparam19       = sccmd.Parameters.Add("@materialReceiptMasterId", SqlDbType.Decimal);
         sprmparam19.Value = rejectionoutmasterinfo.MaterialReceiptMasterId;
         sprmparam19       = sccmd.Parameters.Add("@date", SqlDbType.DateTime);
         sprmparam19.Value = rejectionoutmasterinfo.Date;
         sprmparam19       = sccmd.Parameters.Add("@ledgerId", SqlDbType.Decimal);
         sprmparam19.Value = rejectionoutmasterinfo.LedgerId;
         sprmparam19       = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam19.Value = rejectionoutmasterinfo.Narration;
         sprmparam19       = sccmd.Parameters.Add("@exchangeRateId", SqlDbType.Decimal);
         sprmparam19.Value = rejectionoutmasterinfo.ExchangeRateId;
         sprmparam19       = sccmd.Parameters.Add("@totalAmount", SqlDbType.Decimal);
         sprmparam19.Value = rejectionoutmasterinfo.TotalAmount;
         sprmparam19       = sccmd.Parameters.Add("@userId", SqlDbType.Decimal);
         sprmparam19.Value = rejectionoutmasterinfo.UserId;
         sprmparam19       = sccmd.Parameters.Add("@lrNo", SqlDbType.VarChar);
         sprmparam19.Value = rejectionoutmasterinfo.LrNo;
         sprmparam19       = sccmd.Parameters.Add("@transportationCompany", SqlDbType.VarChar);
         sprmparam19.Value = rejectionoutmasterinfo.TransportationCompany;
         sprmparam19       = sccmd.Parameters.Add("@financialYearId", SqlDbType.Decimal);
         sprmparam19.Value = rejectionoutmasterinfo.FinancialYearId;
         sprmparam19       = sccmd.Parameters.Add("@extraDate", SqlDbType.DateTime);
         sprmparam19.Value = rejectionoutmasterinfo.ExtraDate;
         sprmparam19       = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam19.Value = rejectionoutmasterinfo.Extra1;
         sprmparam19       = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam19.Value = rejectionoutmasterinfo.Extra2;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         base.sqlcon.Close();
     }
 }
        public void RejectionOutMasterEdit(RejectionOutMasterInfo rejectionoutmasterinfo)

        {
            try
            {
                spRejectionOutMaster.RejectionOutMasterEdit(rejectionoutmasterinfo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("RO8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #3
0
        public RejectionOutMasterInfo RejectionOutMasterView(decimal rejectionOutMasterId)
        {
            RejectionOutMasterInfo rejectionoutmasterinfo = new RejectionOutMasterInfo();
            SqlDataReader          sdrreader = null;

            try
            {
                if (base.sqlcon.State == ConnectionState.Closed)
                {
                    base.sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("RejectionOutMasterView", base.sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam2 = new SqlParameter();
                sprmparam2       = sccmd.Parameters.Add("@rejectionOutMasterId", SqlDbType.Decimal);
                sprmparam2.Value = rejectionOutMasterId;
                sdrreader        = sccmd.ExecuteReader();
                while (sdrreader.Read())
                {
                    rejectionoutmasterinfo.RejectionOutMasterId    = decimal.Parse(((DbDataReader)sdrreader)[0].ToString());
                    rejectionoutmasterinfo.VoucherNo               = ((DbDataReader)sdrreader)[1].ToString();
                    rejectionoutmasterinfo.InvoiceNo               = ((DbDataReader)sdrreader)[2].ToString();
                    rejectionoutmasterinfo.SuffixPrefixId          = decimal.Parse(((DbDataReader)sdrreader)[3].ToString());
                    rejectionoutmasterinfo.VoucherTypeId           = decimal.Parse(((DbDataReader)sdrreader)[4].ToString());
                    rejectionoutmasterinfo.MaterialReceiptMasterId = decimal.Parse(((DbDataReader)sdrreader)[5].ToString());
                    rejectionoutmasterinfo.Date                  = DateTime.Parse(((DbDataReader)sdrreader)[6].ToString());
                    rejectionoutmasterinfo.LedgerId              = decimal.Parse(((DbDataReader)sdrreader)[7].ToString());
                    rejectionoutmasterinfo.Narration             = ((DbDataReader)sdrreader)[8].ToString();
                    rejectionoutmasterinfo.ExchangeRateId        = decimal.Parse(((DbDataReader)sdrreader)[9].ToString());
                    rejectionoutmasterinfo.TotalAmount           = decimal.Parse(((DbDataReader)sdrreader)[10].ToString());
                    rejectionoutmasterinfo.UserId                = decimal.Parse(((DbDataReader)sdrreader)[11].ToString());
                    rejectionoutmasterinfo.LrNo                  = ((DbDataReader)sdrreader)[12].ToString();
                    rejectionoutmasterinfo.TransportationCompany = ((DbDataReader)sdrreader)[13].ToString();
                    rejectionoutmasterinfo.FinancialYearId       = decimal.Parse(((DbDataReader)sdrreader)[14].ToString());
                    rejectionoutmasterinfo.ExtraDate             = DateTime.Parse(((DbDataReader)sdrreader)[15].ToString());
                    rejectionoutmasterinfo.Extra1                = ((DbDataReader)sdrreader)[16].ToString();
                    rejectionoutmasterinfo.Extra2                = ((DbDataReader)sdrreader)[17].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sdrreader.Close();
                base.sqlcon.Close();
            }
            return(rejectionoutmasterinfo);
        }
        public RejectionOutMasterInfo RejectionOutMasterView(decimal rejectionOutMasterId)
        {
            RejectionOutMasterInfo infoRejectionOutMaster = new RejectionOutMasterInfo();

            try
            {
                infoRejectionOutMaster = spRejectionOutMaster.RejectionOutMasterView(rejectionOutMasterId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("ROI2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(infoRejectionOutMaster);
        }
        public decimal RejectionOutMasterAddWithReturnIdentity(RejectionOutMasterInfo rejectionoutmasterinfo)
        {
            decimal decIdentity = 0;

            try
            {
                decIdentity = spRejectionOutMaster.RejectionOutMasterAddWithReturnIdentity(rejectionoutmasterinfo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("RO7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(decIdentity);
        }
Exemple #6
0
        public decimal RejectionOutMasterAddWithReturnIdentity(RejectionOutMasterInfo rejectionoutmasterinfo)
        {
            decimal decIdentity = 0m;

            try
            {
                if (base.sqlcon.State == ConnectionState.Closed)
                {
                    base.sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("RejectionOutMasterAddWithReturnIdentity", base.sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam17 = new SqlParameter();
                sprmparam17       = sccmd.Parameters.Add("@voucherNo", SqlDbType.VarChar);
                sprmparam17.Value = rejectionoutmasterinfo.VoucherNo;
                sprmparam17       = sccmd.Parameters.Add("@invoiceNo", SqlDbType.VarChar);
                sprmparam17.Value = rejectionoutmasterinfo.InvoiceNo;
                sprmparam17       = sccmd.Parameters.Add("@suffixPrefixId", SqlDbType.Decimal);
                sprmparam17.Value = rejectionoutmasterinfo.SuffixPrefixId;
                sprmparam17       = sccmd.Parameters.Add("@voucherTypeId", SqlDbType.Decimal);
                sprmparam17.Value = rejectionoutmasterinfo.VoucherTypeId;
                sprmparam17       = sccmd.Parameters.Add("@materialReceiptMasterId", SqlDbType.Decimal);
                sprmparam17.Value = rejectionoutmasterinfo.MaterialReceiptMasterId;
                sprmparam17       = sccmd.Parameters.Add("@date", SqlDbType.DateTime);
                sprmparam17.Value = rejectionoutmasterinfo.Date;
                sprmparam17       = sccmd.Parameters.Add("@ledgerId", SqlDbType.Decimal);
                sprmparam17.Value = rejectionoutmasterinfo.LedgerId;
                sprmparam17       = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
                sprmparam17.Value = rejectionoutmasterinfo.Narration;
                sprmparam17       = sccmd.Parameters.Add("@exchangeRateId", SqlDbType.Decimal);
                sprmparam17.Value = rejectionoutmasterinfo.ExchangeRateId;
                sprmparam17       = sccmd.Parameters.Add("@totalAmount", SqlDbType.Decimal);
                sprmparam17.Value = rejectionoutmasterinfo.TotalAmount;
                sprmparam17       = sccmd.Parameters.Add("@userId", SqlDbType.Decimal);
                sprmparam17.Value = rejectionoutmasterinfo.UserId;
                sprmparam17       = sccmd.Parameters.Add("@lrNo", SqlDbType.VarChar);
                sprmparam17.Value = rejectionoutmasterinfo.LrNo;
                sprmparam17       = sccmd.Parameters.Add("@transportationCompany", SqlDbType.VarChar);
                sprmparam17.Value = rejectionoutmasterinfo.TransportationCompany;
                sprmparam17       = sccmd.Parameters.Add("@financialYearId", SqlDbType.Decimal);
                sprmparam17.Value = rejectionoutmasterinfo.FinancialYearId;
                sprmparam17       = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
                sprmparam17.Value = rejectionoutmasterinfo.Extra1;
                sprmparam17       = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
                sprmparam17.Value = rejectionoutmasterinfo.Extra2;
                object obj = Convert.ToDecimal(sccmd.ExecuteScalar());
                if (obj != null)
                {
                    decIdentity = Convert.ToDecimal(obj);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                base.sqlcon.Close();
            }
            return(decIdentity);
        }
 /// <summary>
 /// Fill function for edit
 /// </summary>
 public void FillRejectionOutReportForEdit()
 {
     try
     {
         dgvProduct.Rows.Clear();
         isDoCellValueChange = false;
         isFromRegister = true;
         btnSave.Text = "Update";
         btnDelete.Enabled = true;
         txtRejectionOutNo.ReadOnly = true;
         infoRejectionOutMaster = bllRejectionOut.RejectionOutMasterView(decRejectionOutId);
         MaterialReceiptBll bllMaterialReceiptMaster = new MaterialReceiptBll();
         MaterialReceiptMasterInfo InfoMaterialReceiptMaster = new MaterialReceiptMasterInfo();
         VoucherTypeInfo infoVoucherType = new VoucherTypeInfo();
         InfoMaterialReceiptMaster = bllMaterialReceiptMaster.MaterialReceiptMasterView(infoRejectionOutMaster.MaterialReceiptMasterId);
         strRejectionOutVoucherNo = bllRejectionOut.GetRejectionOutVoucherNo(infoRejectionOutMaster.RejectionOutMasterId);
         txtRejectionOutNo.Text = infoRejectionOutMaster.InvoiceNo;
         strVoucherNo = infoRejectionOutMaster.VoucherNo.ToString();
         decRejectionOutSuffixPrefixId = Convert.ToDecimal(infoRejectionOutMaster.SuffixPrefixId);
         decRejectionOutVoucherTypeId = Convert.ToDecimal(infoRejectionOutMaster.VoucherTypeId);
         isAutomatic = BllVoucherType.CheckMethodOfVoucherNumbering(decRejectionOutVoucherTypeId);
         infoVoucherType = BllVoucherType.VoucherTypeView(decRejectionOutVoucherTypeId);
         this.Text = infoVoucherType.VoucherTypeName;
         if (!isAutomatic)
         {
             txtRejectionOutNo.ReadOnly = false;
             txtRejectionOutNo.Focus();
         }
         else
         {
             txtRejectionOutNo.ReadOnly = true;
             txtDate.Focus();
         }
         decRejectionOutTypeId = decRejectionOutVoucherTypeId;
         txtDate.Text = infoRejectionOutMaster.Date.ToString("dd-MMM-yyyy");
         cmbCashOrParty.SelectedValue = infoRejectionOutMaster.LedgerId;
         cmbVoucherType.SelectedValue = InfoMaterialReceiptMaster.VoucherTypeId;
         cmbMaterialReceiptNo.SelectedValue = Convert.ToDecimal(infoRejectionOutMaster.MaterialReceiptMasterId.ToString());
         txtTransportationCompany.Text = infoRejectionOutMaster.TransportationCompany;
         txtNarration.Text = infoRejectionOutMaster.Narration;
         cmbCurrency.SelectedValue = infoRejectionOutMaster.ExchangeRateId;
         txtTotalAmount.Text = infoRejectionOutMaster.TotalAmount.ToString();
         txtLrNo.Text = infoRejectionOutMaster.LrNo.ToString();
         List<DataTable> listRejectionOut = bllRejectionOut.RejectionOutDetailsViewByRejectionOutMasterId(infoRejectionOutMaster.RejectionOutMasterId);
         for (int i = 0; i < listRejectionOut[0].Rows.Count; i++)
         {
             dgvProduct.Rows.Add();
             GodownComboFill();
             isAmountcalc = false;
             decRejectionOutDetailId = Convert.ToDecimal(listRejectionOut[0].Rows[i]["rejectionOutDetailsId"].ToString());
             dgvProduct.Rows[i].Cells["dgvtxtSlNo"].Value = listRejectionOut[0].Rows[i]["slno"].ToString();
             dgvProduct.Rows[i].Cells["dgvtxtProductId"].Value = listRejectionOut[0].Rows[i]["productId"].ToString();
             ProductDefaultValues(i, Convert.ToDecimal(listRejectionOut[0].Rows[i]["productId"].ToString()));
             BatchComboFill(Convert.ToDecimal(listRejectionOut[0].Rows[i]["productId"].ToString()), i, dgvProduct.Rows[i].Cells["dgvcmbBatch"].ColumnIndex);
             dgvProduct.Rows[i].Cells["dgvcmbBatch"].Value = Convert.ToDecimal(listRejectionOut[0].Rows[i]["batchId"].ToString());
             dgvProduct.Rows[i].Cells["dgvtxtQty"].Value = listRejectionOut[0].Rows[i]["qty"].ToString();
             UnitComboFill(Convert.ToDecimal(listRejectionOut[0].Rows[i]["productId"].ToString()), i, dgvProduct.Rows[i].Cells["dgvcmbUnit"].ColumnIndex);
             isDoCellValueChange = true;
             isDoAfterGridFill = true;
             isValueChange = true;
             isAmountcalc = true;
             dgvProduct.Rows[i].Cells["dgvcmbUnit"].Value = Convert.ToDecimal(listRejectionOut[0].Rows[i]["unitId"].ToString());
             isDoCellValueChange = false;
             isDoAfterGridFill = false;
             isValueChange = false;
             dgvProduct.Rows[i].Cells["dgvcmbGodown"].Value = Convert.ToDecimal(listRejectionOut[0].Rows[i]["godownId"].ToString());
             RackComboFill(Convert.ToDecimal(listRejectionOut[0].Rows[i]["godownId"].ToString()), dgvProduct, i);
             dgvProduct.Rows[i].Cells["dgvcmbRack"].Value = Convert.ToDecimal(listRejectionOut[0].Rows[i]["rackId"].ToString());
             dgvProduct.Rows[i].Cells["dgvtxtBarcode"].Value = listRejectionOut[0].Rows[i]["barcode"].ToString();
             dgvProduct.Rows[i].Cells["dgvtxtRejectionOutDetailsId"].Value = decRejectionOutDetailId;
             dgvProduct.Rows[i].Cells["dgvtxtRate"].Value = listRejectionOut[0].Rows[i]["rate"].ToString();
             dgvProduct.Rows[i].Cells["dgvtxtAmount"].Value = listRejectionOut[0].Rows[i]["amount"].ToString();
             dgvProduct.Rows[i].Cells["dgvtxtunitConversionId"].Value = listRejectionOut[0].Rows[i]["UnitConversionId"].ToString();
             dgvProduct.Rows[i].Cells["dgvtxtconversionRate"].Value = listRejectionOut[0].Rows[i]["conversionRate"].ToString();
             dgvProduct.Rows[i].Cells["dgvtxtmaterialReceiptDetailsId"].Value = listRejectionOut[0].Rows[i]["materialReceiptDetailsId"].ToString();
         }
         TotalAmount();
         isAmountcalc = true;
         isDoAfterGridFill = true;
         isFromRegister = false;
         isDoCellValueChange = true;
         isValueChange = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show("RO36:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }