private void SaveBt_Click(object sender, EventArgs e) { string portNumber = PortNumberTB.Text; string logicNumber = LogicNumberTB.Text; string user = UserTB.Text; string password = PasswordTB.Text; int modeId = ((SecurityMode)(ModesCB.SelectedItem)).ID; Logic.Config.ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); config.Create(installationId, modeId, null, Convert.ToString(Logic.Config.ParametersLogic.Parameter.CASHREGISTER_PORTNUMBER), portNumber, ""); config.Create(installationId, modeId, null, Convert.ToString(Logic.Config.ParametersLogic.Parameter.CASHREGISTER_LOGICNUMBER), logicNumber, ""); config.Create(installationId, modeId, null, Convert.ToString(Logic.Config.ParametersLogic.Parameter.CASHREGISTER_USER), user, ""); config.Create(installationId, modeId, null, Convert.ToString(Logic.Config.ParametersLogic.Parameter.CASHREGISTER_PASSWORD), password, ""); manager.Save(); }
private void SaveBt_Click(object sender, EventArgs e) { ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); int modeId; int? userId; string parameter; string value; string comment; modeId = Convert.ToInt32(ModeCB.SelectedValue); userId = Convert.ToInt32(UsersCB.SelectedValue); parameter = ParametersCB.SelectedValue.ToString(); value = ValueTB.Text; comment = CommentTB.Text; if (userId <= 0) { userId = null; } if (mode == "new") { config.Create(modeId, userId, parameter, value, comment); } if (mode == "edit") { config.Update(Convert.ToInt32(id), modeId, userId, parameter, value, comment); } manager.Save(); this.Close(); //WareDiscountsLogic discounts = new WareDiscountsLogic(manager); //int discountTypeId = Convert.ToInt32(DiscountTypesCB.SelectedValue); //string name = NameTB.Text; //bool active = ActiveCB.Checked; //decimal defaultDiscountPercent = DefaultDiscountPercentNUD.Value; //if (mode == "new") //{ // discounts.Create(name, active, discountTypeId, defaultDiscountPercent); //} //if (mode == "edit") //{ // discounts.Update(Convert.ToInt32(id), name, active, discountTypeId, defaultDiscountPercent); //} //manager.Save(); //this.Close(); }
private void SaveBt_Click(object sender, EventArgs e) { ConfigurationParametersLogic config = new ConfigurationParametersLogic(manager); int modeId; int? userId; string parameter; string value; string comment; modeId = Convert.ToInt32(ModeCB.SelectedValue); userId = Convert.ToInt32(UsersCB.SelectedValue); parameter = ParametersCB.SelectedValue.ToString(); value = ValueTB.Text; comment = CommentTB.Text; if (userId <= 0) userId = null; if (mode == "new") { config.Create(modeId, userId, parameter, value, comment); } if (mode == "edit") { config.Update(Convert.ToInt32(id), modeId, userId, parameter, value, comment); } manager.Save(); this.Close(); //WareDiscountsLogic discounts = new WareDiscountsLogic(manager); //int discountTypeId = Convert.ToInt32(DiscountTypesCB.SelectedValue); //string name = NameTB.Text; //bool active = ActiveCB.Checked; //decimal defaultDiscountPercent = DefaultDiscountPercentNUD.Value; //if (mode == "new") //{ // discounts.Create(name, active, discountTypeId, defaultDiscountPercent); //} //if (mode == "edit") //{ // discounts.Update(Convert.ToInt32(id), name, active, discountTypeId, defaultDiscountPercent); //} //manager.Save(); //this.Close(); }