Ejemplo n.º 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                objMR.MRDepartmentFrom = objDepDL.Get(Convert.ToInt64(cmbDepartment.SelectedValue));
                objMR.MREnterdBy       = CurrentUser.UserEmp.EmployeeID;
                objMR.MRRemarks        = "No";
                objMR.MRStore          = objStore;
                objMR.MRStatus         = MR.Status.Initial;
                objMR.MRType           = MR.Type.Material;
                objMR.OriginType       = MR.Origin.ToSection;


                if (objMRMaterialCollec.Count > 0)
                {
                    long MRNO = objMRDL.Add_Packing_ToSections(objStore.StoreID, Convert.ToInt32(cmbSection.SelectedValue), Convert.ToInt32(cmbDepartment.SelectedValue),
                                                               CurrentUser.UserEmp.EmployeeID, "Packing for RPD Batches", MR.Status.Initial, MR.Type.Material, (int)MR.Origin.ToSection);
                    if (MRNO > 0)
                    {
                        objMR.MRNO = MRNO;
                        foreach (MRMaterial obj in objMRMaterialCollec)
                        {
                            obj.MR = objMR;
                            objMRMaterialDL.Add(obj);
                        }
                        MessageBox.Show(this, "Successfully Added to Database", "Successfull", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        ClearItem();
                        ClearMR();
                    }
                }
                else
                {
                    MessageBox.Show(this, "Item List is Empty,Please add Items before continue", "Item List is Empty", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }