Exemple #1
0
 private void Save()
 {
     Atend.Base.Equipment.EInsulatorPipe insPipe = new Atend.Base.Equipment.EInsulatorPipe();
     insPipe.Name        = txtName.Text;
     insPipe.ProductCode = Atend.Control.Common.selectedProductCode;
     insPipe.IsDefault   = IsDefault;
     insPipe.Code        = 0;
     if (SelectedInsulatorPipeXCode == Guid.Empty)
     {
         if (insPipe.InsertX())
         {
             Reset();
         }
         else
         {
             MessageBox.Show("امکان ثبت اطلاعات نمی باشد", "خطا");
         }
     }
     else
     {
         insPipe.XCode = SelectedInsulatorPipeXCode;
         insPipe.Code  = Code;
         if (insPipe.UpdateX())
         {
             Reset();
         }
         else
         {
             MessageBox.Show("امکان به روز رسانی اطلاعات نمی باشد", "خطا");
         }
     }
 }
Exemple #2
0
        public void BindDataToOwnControl(Guid XCode)
        {
            Atend.Base.Equipment.EInsulatorPipe insPipe = Atend.Base.Equipment.EInsulatorPipe.SelectByXCode(XCode);
            //Atend.Base.Base.BProduct product = Atend.Base.Base.BProduct.Select_ByCode(reCloser.ProductCode);
            Atend.Control.Common.selectedProductCode = insPipe.ProductCode;
            SelectProduct();

            SelectedInsulatorPipeXCode = XCode;
            txtName.Text = insPipe.Name;

            tsbIsDefault.Checked = insPipe.IsDefault;
            Code = insPipe.Code;
        }
Exemple #3
0
 private void tsbShare_Click(object sender, EventArgs e)
 {
     if (SelectedInsulatorPipeXCode != Guid.Empty)
     {
         if (Atend.Base.Equipment.EContainerPackage.ShareOnServer(Convert.ToInt32(Atend.Control.Enum.ProductType.InsulatorPipe), SelectedInsulatorPipeXCode))
         {
             Atend.Base.Equipment.EInsulatorPipe InsPipe = Atend.Base.Equipment.EInsulatorPipe.SelectByXCode(SelectedInsulatorPipeXCode);
             Code = InsPipe.Code;
             MessageBox.Show("به اشتراک گذاری با موفقیت انجام شد");
         }
         else
         {
             MessageBox.Show("خطا در به اشتراک گذاری .");
         }
     }
     else
     {
         MessageBox.Show("لطفا تجهیز مورد نظر را انتخاب کنید");
     }
 }
Exemple #4
0
 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 (SelectedInsulatorPipeXCode == Guid.Empty && IsDefault)
         {
             MessageBox.Show("کاربر گرامی شما اجازه ثبت تجهیز به صورت پیش فرض ندارید", "خطا");
             return(false);
         }
         else
         {
             Atend.Base.Equipment.EInsulatorPipe insPipe = Atend.Base.Equipment.EInsulatorPipe.SelectByXCode(SelectedInsulatorPipeXCode);
             if (insPipe.IsDefault || IsDefault)
             {
                 MessageBox.Show("کاربر گرامی شما اجازه ویرایش  تجهیز به صورت پیش فرض ندارید", "خطا");
                 return(false);
             }
         }
     }
     return(true);
 }