private void Save() { Atend.Base.Equipment.ERamp Ramp = new Atend.Base.Equipment.ERamp(); Ramp.Name = txtName.Text; Ramp.ProductCode = Atend.Control.Common.selectedProductCode; Ramp.IsDefault = IsDefault; Ramp.Code = 0; if (SelectedRampXCode == Guid.Empty) { if (Ramp.InsertX()) { Reset(); } else { MessageBox.Show("امکان ثبت اطلاعات نمی باشد", "خطا"); } } else { Ramp.XCode = SelectedRampXCode; Ramp.Code = Code; if (Ramp.UpdateX()) { Reset(); } else { MessageBox.Show("امکان به روز رسانی اطلاعات نمی باشد", "خطا"); } } }
public void BindDataToOwnControl(Guid XCode) { Atend.Base.Equipment.ERamp Ramp = Atend.Base.Equipment.ERamp.SelectByXCode(XCode); //Atend.Base.Base.BProduct product = Atend.Base.Base.BProduct.Select_ByCode(reCloser.ProductCode); Atend.Control.Common.selectedProductCode = Ramp.ProductCode; SelectProduct(); SelectedRampXCode = XCode; txtName.Text = Ramp.Name; tsbIsDefault.Checked = Ramp.IsDefault; Code = Ramp.Code; }
private void tsbShare_Click(object sender, EventArgs e) { if (SelectedRampXCode != Guid.Empty) { if (Atend.Base.Equipment.EContainerPackage.ShareOnServer(Convert.ToInt32(Atend.Control.Enum.ProductType.Ramp), SelectedRampXCode)) { Atend.Base.Equipment.ERamp Ramp = Atend.Base.Equipment.ERamp.SelectByXCode(SelectedRampXCode); Code = Ramp.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 (SelectedRampXCode == Guid.Empty && IsDefault) { MessageBox.Show("کاربر گرامی شما اجازه ثبت تجهیز به صورت پیش فرض ندارید", "خطا"); return(false); } else { Atend.Base.Equipment.ERamp Eramp = Atend.Base.Equipment.ERamp.SelectByXCode(SelectedRampXCode); if (Eramp.IsDefault || IsDefault) { MessageBox.Show("کاربر گرامی شما اجازه ویرایش تجهیز به صورت پیش فرض ندارید", "خطا"); return(false); } } } return(true); }