protected void btnSaveAdd_Click(object sender, EventArgs e)
 {
     if (!this.Page.IsValid)
     {
         return;
     }
     if (this.txtItemName.Text.Trim().Length > 0)
     {
         this.objItemMasterDT = this.objItemMasterBll.GetDataByItemName(int.Parse(this.hfCompanyID.Value), this.txtItemName.Text.Trim());
         if (this.objItemMasterDT.Rows.Count > 0)
         {
             this.checkInDB = true;
             this.DisplayAlert("Item Already Exists..!");
         }
         if (this.checkInDB)
         {
             return;
         }
         Decimal?dUnitCost     = new Decimal?();
         Decimal?dQuantity     = new Decimal?();
         Decimal?dCurrentStock = new Decimal?();
         int?    iTaskID1      = new int?();
         int?    iTaskID2      = new int?();
         if (this.ddlTax.SelectedIndex > 0)
         {
             iTaskID1 = new int?(int.Parse(this.ddlTax.SelectedItem.Value));
         }
         if (this.ddlTax2.SelectedIndex > 0)
         {
             iTaskID2 = new int?(int.Parse(this.ddlTax2.SelectedItem.Value));
         }
         if (this.txtQuantity.Text.Trim().Length > 0)
         {
             dQuantity = new Decimal?(Decimal.Parse(this.txtQuantity.Text.Trim()));
         }
         if (this.txtCurrentStock.Text.Trim().Length > 0)
         {
             dCurrentStock = new Decimal?(Decimal.Parse(this.txtCurrentStock.Text.Trim()));
         }
         if (this.txtUnitCost.Text.Trim().Length > 0)
         {
             dUnitCost = new Decimal?(Decimal.Parse(this.txtUnitCost.Text.Trim()));
         }
         if (this.objItemMasterBll.AddItem(int.Parse(this.hfCompanyID.Value), this.txtItemName.Text.Trim(), this.txtItemDesc.Text.Trim(), dUnitCost, dQuantity, iTaskID1, iTaskID2, this.chkInventory.Checked, dCurrentStock, true, false, false) != 0)
         {
             this.Session["saveItem"] = (object)1;
             this.DisplayAlert("Details Added Successfully.");
             this.btnAdd_Click(sender, e);
         }
         else
         {
             this.DisplayAlert("Fail to Add New Details.");
             this.Clear();
         }
     }
     else
     {
         this.DisplayAlert("Please Fill All Details...!");
     }
 }
Exemple #2
0
 public virtual CloudAccountDA.ItemMasterDataTable GetData()
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     CloudAccountDA.ItemMasterDataTable dataTable = new CloudAccountDA.ItemMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
Exemple #3
0
 public virtual CloudAccountDA.ItemMasterDataTable UpdateWhenDelete(int?ItemID, bool?Active, bool?Deleted)
 {
     this.Adapter.SelectCommand = this.CommandCollection[8];
     if (ItemID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = ItemID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     if (Active.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[2].Value = Active.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value;
     }
     if (Deleted.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[3].Value = Deleted.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[3].Value = DBNull.Value;
     }
     CloudAccountDA.ItemMasterDataTable dataTable = new CloudAccountDA.ItemMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
        private void SetRecord(string iD)
        {
            this.objItemMasterDT = this.objItemMasterBll.GetDataByItemID(int.Parse(iD));
            if (this.objItemMasterDT.Rows.Count <= 0)
            {
                return;
            }
            this.hfItemID.Value       = this.objItemMasterDT.Rows[0]["ItemID"].ToString();
            this.hfCompanyID.Value    = this.objItemMasterDT.Rows[0]["CompanyID"].ToString();
            this.txtItemName.Text     = this.objItemMasterDT.Rows[0]["ItemName"].ToString();
            this.txtItemDesc.Text     = this.objItemMasterDT.Rows[0]["Description"].ToString();
            this.txtUnitCost.Text     = this.objItemMasterDT.Rows[0]["UnitCost"].ToString();
            this.txtCurrentStock.Text = this.objItemMasterDT.Rows[0]["CurrentStock"].ToString();
            this.txtQuantity.Text     = this.objItemMasterDT.Rows[0]["Quantity"].ToString();
            this.chkInventory.Checked = bool.Parse(this.objItemMasterDT.Rows[0]["TrackInventory"].ToString());
            this.chkInventory_CheckedChanged((object)null, (EventArgs)null);
            string str1 = this.objItemMasterDT.Rows[0]["TaxID1"].ToString();
            string str2 = this.objItemMasterDT.Rows[0]["TaxID2"].ToString();

            if (!string.IsNullOrEmpty(str1))
            {
                this.ddlTax.SelectedValue = str1;
            }
            if (string.IsNullOrEmpty(str2))
            {
                return;
            }
            this.ddlTax.SelectedValue = str2;
        }
        private void ViewRecord(string iD)
        {
            this.objItemMasterDT = this.objItemMasterBll.GetDataByItemID(int.Parse(iD));
            if (this.objItemMasterDT.Rows.Count <= 0)
            {
                return;
            }
            this.hfItemID.Value       = this.objItemMasterDT.Rows[0]["ItemID"].ToString();
            this.hfCompanyID.Value    = this.objItemMasterDT.Rows[0]["CompanyID"].ToString();
            this.lblItemName.Text     = this.objItemMasterDT.Rows[0]["ItemName"].ToString();
            this.lblItemDesc.Text     = this.objItemMasterDT.Rows[0]["Description"].ToString();
            this.lblUnitCost.Text     = this.objItemMasterDT.Rows[0]["UnitCost"].ToString();
            this.lblCurrentStock.Text = this.objItemMasterDT.Rows[0]["CurrentStock"].ToString();
            this.lblQuantity.Text     = this.objItemMasterDT.Rows[0]["Quantity"].ToString();
            this.lblInventory.Text    = this.objItemMasterDT.Rows[0]["TrackInventory"].ToString();
            string s1 = this.objItemMasterDT.Rows[0]["TaxID1"].ToString();
            string s2 = this.objItemMasterDT.Rows[0]["TaxID2"].ToString();

            if (!string.IsNullOrEmpty(s1))
            {
                this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(s1));
                this.lblTax.Text    = this.objTaxMasterDT.Rows[0]["TaxName"].ToString();
            }
            if (string.IsNullOrEmpty(s2))
            {
                return;
            }
            this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(s2));
            this.lblTax2.Text   = this.objTaxMasterDT.Rows[0]["TaxName"].ToString();
        }
Exemple #6
0
 public virtual int Fill(CloudAccountDA.ItemMasterDataTable dataTable)
 {
     this.Adapter.SelectCommand = this.CommandCollection[0];
     if (this.ClearBeforeFill)
     {
         dataTable.Clear();
     }
     return(this.Adapter.Fill(dataTable));
 }
Exemple #7
0
 public virtual CloudAccountDA.ItemMasterDataTable DeleteByCompanyID(int?CompanyID)
 {
     this.Adapter.SelectCommand = this.CommandCollection[1];
     if (CompanyID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     CloudAccountDA.ItemMasterDataTable dataTable = new CloudAccountDA.ItemMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
        protected void gvItemView_OnRowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.DataRow)
            {
                return;
            }
            string text1 = e.Row.Cells[0].Text;
            string text2 = e.Row.Cells[4].Text;
            string text3 = e.Row.Cells[5].Text;

            this.objItemMasterDT = this.objItemMasterBll.GetDataByItemID(int.Parse(text1));
            if (this.objItemMasterDT.Rows.Count > 0)
            {
                e.Row.Cells[0].Text = this.objItemMasterDT.Rows[0]["ItemName"].ToString();
            }
            try
            {
                if (!string.IsNullOrEmpty(text2) && !text2.Contains("&"))
                {
                    this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(text2));
                    if (this.objTaxMasterDT.Rows.Count > 0)
                    {
                        e.Row.Cells[4].Text = this.objTaxMasterDT.Rows[0]["TaxName"].ToString();
                    }
                }
                if (string.IsNullOrEmpty(text3) || text3.Contains("&"))
                {
                    return;
                }
                this.objTaxMasterDT = this.objTaxMasterBll.GetDataByTaxID(int.Parse(text3));
                if (this.objTaxMasterDT.Rows.Count <= 0)
                {
                    return;
                }
                e.Row.Cells[5].Text = this.objTaxMasterDT.Rows[0]["TaxName"].ToString();
            }
            catch (Exception ex)
            {
                e.Row.Cells[4].Text = "";
                e.Row.Cells[5].Text = "";
            }
        }
Exemple #9
0
 public virtual CloudAccountDA.ItemMasterDataTable UpdateCurrentStock(int?ItemID, decimal?CurrentStock)
 {
     this.Adapter.SelectCommand = this.CommandCollection[6];
     if (ItemID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = ItemID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     if (CurrentStock.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[2].Value = CurrentStock.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value;
     }
     CloudAccountDA.ItemMasterDataTable dataTable = new CloudAccountDA.ItemMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
Exemple #10
0
 public virtual CloudAccountDA.ItemMasterDataTable GetDataByItemName(int?CompanyID, string ItemName)
 {
     this.Adapter.SelectCommand = this.CommandCollection[5];
     if (CompanyID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     if (ItemName == null)
     {
         this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[2].Value = ItemName;
     }
     CloudAccountDA.ItemMasterDataTable dataTable = new CloudAccountDA.ItemMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }
Exemple #11
0
 public virtual int Update(CloudAccountDA.ItemMasterDataTable dataTable)
 {
     return(this.Adapter.Update(dataTable));
 }
Exemple #12
0
 public virtual CloudAccountDA.ItemMasterDataTable GetDataByCompanyIDAndStatus(int?CompanyID, bool?Active, bool?Archived, bool?Deleted, string ItemName, string ItemDesc, string Tax, decimal?UnitCostTo, decimal?UnitCostFrom, decimal?InvetoryTo, decimal?InvetoryFrom, decimal?QuantityTo, decimal?QuantityFrom)
 {
     this.Adapter.SelectCommand = this.CommandCollection[3];
     if (CompanyID.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[1].Value = CompanyID.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[1].Value = DBNull.Value;
     }
     if (Active.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[2].Value = Active.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[2].Value = DBNull.Value;
     }
     if (Archived.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[3].Value = Archived.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[3].Value = DBNull.Value;
     }
     if (Deleted.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[4].Value = Deleted.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[4].Value = DBNull.Value;
     }
     if (ItemName == null)
     {
         this.Adapter.SelectCommand.Parameters[5].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[5].Value = ItemName;
     }
     if (ItemDesc == null)
     {
         this.Adapter.SelectCommand.Parameters[6].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[6].Value = ItemDesc;
     }
     if (Tax == null)
     {
         this.Adapter.SelectCommand.Parameters[7].Value = DBNull.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[7].Value = Tax;
     }
     if (UnitCostTo.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[8].Value = UnitCostTo.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[8].Value = DBNull.Value;
     }
     if (UnitCostFrom.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[9].Value = UnitCostFrom.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[9].Value = DBNull.Value;
     }
     if (InvetoryTo.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[10].Value = InvetoryTo.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[10].Value = DBNull.Value;
     }
     if (InvetoryFrom.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[11].Value = InvetoryFrom.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[11].Value = DBNull.Value;
     }
     if (QuantityTo.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[12].Value = QuantityTo.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[12].Value = DBNull.Value;
     }
     if (QuantityFrom.HasValue)
     {
         this.Adapter.SelectCommand.Parameters[13].Value = QuantityFrom.Value;
     }
     else
     {
         this.Adapter.SelectCommand.Parameters[13].Value = DBNull.Value;
     }
     CloudAccountDA.ItemMasterDataTable dataTable = new CloudAccountDA.ItemMasterDataTable();
     this.Adapter.Fill(dataTable);
     return(dataTable);
 }