コード例 #1
0
 /// <summary>
 /// Create a new adjustment_View object.
 /// </summary>
 /// <param name="adjustmentID">Initial value of the AdjustmentID property.</param>
 /// <param name="item_Code">Initial value of the Item_Code property.</param>
 /// <param name="quantity">Initial value of the Quantity property.</param>
 /// <param name="reason">Initial value of the Reason property.</param>
 /// <param name="status">Initial value of the Status property.</param>
 public static adjustment_View Createadjustment_View(global::System.Int32 adjustmentID, global::System.String item_Code, global::System.Int32 quantity, global::System.String reason, global::System.String status)
 {
     adjustment_View adjustment_View = new adjustment_View();
     adjustment_View.AdjustmentID = adjustmentID;
     adjustment_View.Item_Code = item_Code;
     adjustment_View.Quantity = quantity;
     adjustment_View.Reason = reason;
     adjustment_View.Status = status;
     return adjustment_View;
 }
コード例 #2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            adjustment_View adjust_view = new adjustment_View();
            AdjustmentBLL adjustbll = new AdjustmentBLL();

            //int adjustBy_Id = 1005;
              // int loginUserId = 1002;// current login User who will make Adjustment Report
            int loginUserId = Convert.ToInt32(Session["loginUser"]);
            DateTime adjustDate = DateTime.Now;
            //DateTime adjustDate = DateTime.Today;

            int itemPrice = Convert.ToInt32(ddlPrice.SelectedItem.Value);

            //int approvedBy = null;
            //DateTime approveDate = null;
            //string approveStatus = null;
            double total_price = 0;
            foreach (GridViewRow row in gvAdjustList.Rows)
            {

                string item_code = row.Cells[1].Text;
                int qty = Convert.ToInt32(row.Cells[2].Text);

                StockItemBLL itemBll = new StockItemBLL();
                double price = itemBll.GetItemPrice(item_code);

                total_price = total_price + (price * qty);

                /********* Don't delete lbl testing line **********/
                //lblPrice.Text = price.ToString();
                //lblTotalPrice.Text = total_price.ToString(); // don't delete

            }
            string authorizedBy = null;

            if (total_price <= 250)
            {
                authorizedBy = "Supervisor";
            }
            else
            {
                authorizedBy = "Manager";
            }
            int adjustid = adjustbll.addAdjustment(loginUserId, adjustDate, authorizedBy);

            foreach (GridViewRow row in gvAdjustList.Rows)
            {
                string item_code = row.Cells[1].Text;
                int qty = Convert.ToInt32(row.Cells[2].Text);
                string reason = row.Cells[3].Text;
                string status = row.Cells[4].Text;

                AdjustmentDetailsBLL adjust_details_bll = new AdjustmentDetailsBLL();
                int adjustment_details_Id = adjust_details_bll.addAdjustmentDetails(adjustid, item_code, qty, reason, status);

            }

            Employee emp_bll = new Employee();
            //int loginUserId = 1002;
            string email_body = "Adjustment Report is submitted to Supervier or Manager by StoreClerk";
            string email_subj = "Issue Adjustment Report";
            string email_msg = SendEmailNotification(loginUserId, email_body, email_subj, authorizedBy);

            lblSubmitMsg.Text = "Adjustment Report Submittion is successful. " + email_msg;
        }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the adjustment_View EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToadjustment_View(adjustment_View adjustment_View)
 {
     base.AddObject("adjustment_View", adjustment_View);
 }