Exemplo n.º 1
0
        private void AddNewDesign()
        {
            DialogResult Ds = MessageBox.Show("Are you sure to add new design ?", "Mr. Solutions", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (Ds == DialogResult.Yes)
            {
                _objDocPrintSetting.PrintSettingList.Clear();
                PrintSettingModel ObjPtintSetting = new PrintSettingModel
                {
                    DesignName     = DesingName,
                    DesignPath     = DesignPath,
                    DesignUrl      = "",
                    Module         = ModuleName,
                    Remarks        = "",
                    DefaultPrinter = "",
                    NoOfCopy       = 1,
                    SaveAndPrint   = 0,
                    IsEnable       = 1,
                    DesignType     = "Crystal"
                };

                _objDocPrintSetting.PrintSettingList.Add(ObjPtintSetting);
                _objDocPrintSetting.SavePrintSetting("ADD");
                MessageBox.Show("Design added Successfully !", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            LoadExistingDesigns();
        }
Exemplo n.º 2
0
        private void BtnOk_Click(object sender, EventArgs e)
        {
            if (Grid.Rows.Count > 0)
            {
                DialogResult Ds = MessageBox.Show("Are you sure to update the changes ?", "Mr. Solutions", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (Ds == DialogResult.Yes)
                {
                    _objDocPrintSetting.PrintSettingList.Clear();
                    PrintSettingModel ObjPtintSetting = null;
                    foreach (DataGridViewRow ro in Grid.Rows)
                    {
                        if (ro.Cells["DesignName"].Value != null && ro.Cells["Module"].Value != null)
                        {
                            ObjPtintSetting = new PrintSettingModel
                            {
                                PrintDesignId  = Convert.ToInt32(ro.Cells["PrintDesignId"].Value),
                                DesignName     = ro.Cells["DesignName"].Value.ToString(),
                                Module         = ro.Cells["Module"].Value.ToString(),
                                Remarks        = ro.Cells["Remarks"].Value.ToString(),
                                DefaultPrinter = ro.Cells["Printer"].Value.ToString(),
                                DesignPath     = ro.Cells["Path"].Value.ToString(),
                                NoOfCopy       = Convert.ToInt32(ro.Cells["NumberOfCopy"].Value)
                            };
                            if (Convert.ToBoolean(ro.Cells["DirectPrint"].Value).ToString() == "True")
                            {
                                ObjPtintSetting.SaveAndPrint = 1;
                            }
                            else
                            {
                                ObjPtintSetting.SaveAndPrint = 0;
                            }

                            if (Convert.ToBoolean(ro.Cells["Active"].Value).ToString() == "True")
                            {
                                ObjPtintSetting.IsEnable = 1;
                            }
                            else
                            {
                                ObjPtintSetting.IsEnable = 0;
                            }
                            ObjPtintSetting.DesignType = ro.Cells["DesignType"].Value.ToString();
                            _objDocPrintSetting.PrintSettingList.Add(ObjPtintSetting);
                        }
                    }
                }
                _objDocPrintSetting.SavePrintSetting("UPDATE");
                MessageBox.Show("Update Successfully !", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                LoadExistingDesigns();
            }
            else
            {
                MessageBox.Show("No change are available for save.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }