private void Save() { Atend.Base.Equipment.EProp Prop = new Atend.Base.Equipment.EProp(); Prop.Name = txtName.Text; Prop.ProductCode = Atend.Control.Common.selectedProductCode; Prop.IsDefault = IsDefault; Prop.Code = 0; if (SelectedPropXCode == Guid.Empty) { if (Prop.InsertX()) { Reset(); } else { MessageBox.Show("امکان ثبت اطلاعات نمی باشد", "خطا"); } } else { Prop.XCode = SelectedPropXCode; Prop.Code = Code; if (Prop.UpdateX()) { Reset(); } else { MessageBox.Show("امکان به روز رسانی اطلاعات نمی باشد", "خطا"); } } }
public void BindDataToOwnControl(Guid XCode) { Atend.Base.Equipment.EProp pro = Atend.Base.Equipment.EProp.SelectByXCode(XCode); //Atend.Base.Base.BProduct product = Atend.Base.Base.BProduct.Select_ByCode(reCloser.ProductCode); Atend.Control.Common.selectedProductCode = pro.ProductCode; SelectProduct(); SelectedPropXCode = XCode; txtName.Text = pro.Name; tsbIsDefault.Checked = pro.IsDefault; Code = pro.Code; }
private void tsbShare_Click(object sender, EventArgs e) { if (SelectedPropXCode != Guid.Empty) { if (Atend.Base.Equipment.EContainerPackage.ShareOnServer(Convert.ToInt32(Atend.Control.Enum.ProductType.Prop), SelectedPropXCode)) { Atend.Base.Equipment.EProp Prop = Atend.Base.Equipment.EProp.SelectByXCode(SelectedPropXCode); Code = Prop.Code; MessageBox.Show("به اشتراک گذاری با موفقیت انجام شد"); } else { MessageBox.Show("خطا در به اشتراک گذاری ."); } } else { MessageBox.Show("لطفا تجهیز مورد نظر را انتخاب کنید"); } }
private bool CheckStatuseOfAccessChangeDefault() { Autodesk.AutoCAD.EditorInput.Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; //ed.WriteMessage("AccessChangeDefault={0}\n", Atend.Control.Common.AccessChangeDefault); if (!Atend.Control.Common.AccessChangeDefault) { if (SelectedPropXCode == Guid.Empty && IsDefault) { MessageBox.Show("کاربر گرامی شما اجازه ثبت تجهیز به صورت پیش فرض ندارید", "خطا"); return(false); } else { Atend.Base.Equipment.EProp prop = Atend.Base.Equipment.EProp.SelectByXCode(SelectedPropXCode); if (prop.IsDefault || IsDefault) { MessageBox.Show("کاربر گرامی شما اجازه ویرایش تجهیز به صورت پیش فرض ندارید", "خطا"); return(false); } } } return(true); }