Ejemplo n.º 1
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         INV_MRRInfo iNV_MRRInfo = new INV_MRRInfo();
         iNV_MRRInfo.MRRInfoID = int.Parse(Request.QueryString["ID"].ToString());
         iNV_MRRInfo.CampusID = 0;// int.Parse(ddlCampusID.SelectedValue);
         iNV_MRRInfo.MRRInfoMasterID = 0;// int.Parse(ddlMRRInfoMasterID.SelectedValue);
         iNV_MRRInfo.MRRCode = txtMRRCode.Text;
         iNV_MRRInfo.IteamID = int.Parse(ddlIteamID.SelectedValue);
         iNV_MRRInfo.TagID = "0";// ddlTagID.SelectedValue;
         iNV_MRRInfo.Quantity = decimal.Parse(txtQuantity.Text);
         iNV_MRRInfo.MRRAmount = decimal.Parse(txtMRRAmount.Text);
         iNV_MRRInfo.SaleAmount = decimal.Parse(txtSaleAmount.Text);
         iNV_MRRInfo.MRRDate = DateTime.Parse(txtMRRDate.Text);
         iNV_MRRInfo.StoreID = int.Parse(ddlStoreID.SelectedValue);
          INV_Store store = INV_StoreManager.GetINV_StoreByStoreID(iNV_MRRInfo.StoreID);
          if (store != null)
          {
              iNV_MRRInfo.CampusID = store.CampusID;
          }
         bool resutl = INV_MRRInfoManager.UpdateINV_MRRInfo(iNV_MRRInfo);
     }
     catch (Exception ex) { } Response.Redirect("AdminDisplayINV_MRRInfo.aspx");
 }
Ejemplo n.º 2
0
    public bool UpdateINV_MRRInfo(INV_MRRInfo iNV_MRRInfo)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateINV_MRRInfo", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@MRRInfoID", SqlDbType.Int).Value = iNV_MRRInfo.MRRInfoID;
            cmd.Parameters.Add("@CampusID", SqlDbType.Int).Value = iNV_MRRInfo.CampusID;
            cmd.Parameters.Add("@MRRInfoMasterID", SqlDbType.Int).Value = iNV_MRRInfo.MRRInfoMasterID;
            cmd.Parameters.Add("@MRRCode", SqlDbType.NVarChar).Value = iNV_MRRInfo.MRRCode;
            cmd.Parameters.Add("@IteamID", SqlDbType.Int).Value = iNV_MRRInfo.IteamID;
            cmd.Parameters.Add("@TagID", SqlDbType.NVarChar).Value = iNV_MRRInfo.TagID;
            cmd.Parameters.Add("@Quantity", SqlDbType.Decimal).Value = iNV_MRRInfo.Quantity;
            cmd.Parameters.Add("@MRRAmount", SqlDbType.Decimal).Value = iNV_MRRInfo.MRRAmount;
            cmd.Parameters.Add("@SaleAmount", SqlDbType.Decimal).Value = iNV_MRRInfo.SaleAmount;
            cmd.Parameters.Add("@MRRDate", SqlDbType.DateTime).Value = iNV_MRRInfo.MRRDate;
            cmd.Parameters.Add("@StoreID", SqlDbType.Int).Value = iNV_MRRInfo.StoreID;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Ejemplo n.º 3
0
    public INV_MRRInfo GetINV_MRRInfoFromReader(IDataReader reader)
    {
        try
        {
            INV_MRRInfo iNV_MRRInfo = new INV_MRRInfo
                (

                     DataAccessObject.IsNULL<int>(reader["MRRInfoID"]),
                     DataAccessObject.IsNULL<int>(reader["CampusID"]),
                     DataAccessObject.IsNULL<int>(reader["MRRInfoMasterID"]),
                     DataAccessObject.IsNULL<string>(reader["MRRCode"]),
                     DataAccessObject.IsNULL<int>(reader["IteamID"]),
                     DataAccessObject.IsNULL<string>(reader["TagID"]),
                     DataAccessObject.IsNULL<decimal>(reader["Quantity"]),
                     DataAccessObject.IsNULL<decimal>(reader["MRRAmount"]),
                     DataAccessObject.IsNULL<decimal>(reader["SaleAmount"]),
                     DataAccessObject.IsNULL<DateTime>(reader["MRRDate"]),
                     DataAccessObject.IsNULL<int>(reader["StoreID"])
                );
             return iNV_MRRInfo;
        }
        catch(Exception ex)
        {
            return null;
        }
    }
Ejemplo n.º 4
0
 private void showINV_MRRInfoData()
 {
     INV_MRRInfo iNV_MRRInfo = new INV_MRRInfo();
     iNV_MRRInfo = INV_MRRInfoManager.GetINV_MRRInfoByMRRInfoID(Int32.Parse(Request.QueryString["ID"]));
     //ddlCampusID.SelectedValue = iNV_MRRInfo.CampusID.ToString();
     //ddlMRRInfoMasterID.SelectedValue = iNV_MRRInfo.MRRInfoMasterID.ToString();
     txtMRRCode.Text = iNV_MRRInfo.MRRCode.ToString();
     txtMRRCode.ReadOnly = true;
     ddlIteamID.SelectedValue = iNV_MRRInfo.IteamID.ToString();
        // ddlTagID.SelectedValue = iNV_MRRInfo.TagID.ToString();
     string[] qntArray = iNV_MRRInfo.Quantity.ToString().Split('.');
     txtQuantity.Text = qntArray.Length > 0 ? qntArray[0] : "0";
     txtMRRAmount.Text = iNV_MRRInfo.MRRAmount.ToString("N");
     txtSaleAmount.Text = iNV_MRRInfo.SaleAmount.ToString("N");
     txtMRRDate.Text = iNV_MRRInfo.MRRDate.ToString("dd MMM yyyy");
     ddlStoreID.SelectedValue = iNV_MRRInfo.StoreID.ToString();
 }