コード例 #1
0
ファイル: frmGround02.cs プロジェクト: ParisaMousavi/ATEND
 private void tsbShare_Click(object sender, EventArgs e)
 {
     if (selectedGround != Guid.Empty)
     {
         if (Atend.Base.Equipment.EContainerPackage.ShareOnServer(Convert.ToInt32(Atend.Control.Enum.ProductType.Ground), selectedGround))
         {
             Atend.Base.Equipment.EGround Ground = Atend.Base.Equipment.EGround.SelectByXCode(selectedGround);
             Code = Ground.Code;
             MessageBox.Show("به اشتراک گذاری با موفقیت انجام شد");
         }
         else
         {
             MessageBox.Show("خطا در به اشتراک گذاری .");
         }
     }
     else
     {
         MessageBox.Show("لطفا تجهیز مورد نظر را انتخاب کنید");
     }
     //if (selectedGround != Guid.Empty)
     //{
     //    if (Atend.Base.Equipment.EGround.ShareOnServer(selectedGround))
     //    {
     //        Atend.Base.Equipment.EGround g1 = Atend.Base.Equipment.EGround.SelectByXCode(selectedGround);
     //        Code = g1.Code;
     //        MessageBox.Show("به اشتراک گذاری با موفقیت انجام شد");
     //    }
     //    else
     //        MessageBox.Show("خطا در به اشتراک گذاری . لطفاً دوباره سعی کنید");
     //}
     //else
     //    MessageBox.Show("لطفا تجهیز مورد نظر را انتخاب کنید");
 }
コード例 #2
0
ファイル: frmGround02.cs プロジェクト: ParisaMousavi/ATEND
        private void Save()
        {
            txtName.Focus();
            Atend.Base.Equipment.EGround ground = new Atend.Base.Equipment.EGround();
            ground.ProductCode = Atend.Control.Common.selectedProductCode;
            ground.Comment     = txtComment.Text;
            ground.Name        = txtName.Text;
            ground.IsDefault   = IsDefault;
            ground.Code        = Code;

            //Equipment
            ArrayList EPackageProduct = new ArrayList();

            for (int j = 0; j < gvSelectedEquipment.Rows.Count; j++)
            {
                Atend.Base.Equipment.EProductPackage _EProductPackage = new Atend.Base.Equipment.EProductPackage();
                _EProductPackage.XCode     = new Guid(gvSelectedEquipment.Rows[j].Cells[0].Value.ToString());
                _EProductPackage.Count     = Convert.ToInt32(gvSelectedEquipment.Rows[j].Cells[2].Value.ToString());
                _EProductPackage.TableType = Convert.ToInt16(gvSelectedEquipment.Rows[j].Cells[3].Value.ToString());
                EPackageProduct.Add(_EProductPackage);
            }
            ground.EquipmentList = EPackageProduct;

            //Operation
            ArrayList EOperation = new ArrayList();

            for (int i = 0; i < gvOperation.Rows.Count; i++)
            {
                Atend.Base.Equipment.EOperation _EOperation = new Atend.Base.Equipment.EOperation();
                _EOperation.ProductID = Convert.ToInt32(gvOperation.Rows[i].Cells[0].Value);
                _EOperation.Count     = Convert.ToDouble(gvOperation.Rows[i].Cells[3].Value);
                EOperation.Add(_EOperation);
            }
            ground.OperationList = EOperation;
            if (selectedGround == Guid.Empty)
            {
                if (ground.InsertX())
                {
                    Reset();
                }
                else
                {
                    MessageBox.Show("امکان ثبت اطلاعات نمی باشد", "خطا");
                }
            }
            else
            {
                ground.XCode = selectedGround;
                if (ground.UpdateX())
                {
                    Reset();
                }
                else
                {
                    MessageBox.Show("امکان ذخیره سازی اطلاعات نمی باشد", "خطا");
                }
            }
        }
コード例 #3
0
ファイル: frmGround02.cs プロジェクト: ParisaMousavi/ATEND
 public void BindDataToOwnControl(Guid XCode)
 {
     selectedGround = XCode;
     Atend.Base.Equipment.EGround ground = Atend.Base.Equipment.EGround.SelectByXCode(XCode);
     Atend.Control.Common.selectedProductCode = ground.ProductCode;
     SelectProduct();
     txtName.Text         = ground.Name;
     txtComment.Text      = ground.Comment;
     tsbIsDefault.Checked = ground.IsDefault;
     Code = ground.Code;
     BindTreeViwAndGrid();
 }
コード例 #4
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (Validation())
            {
                Atend.Base.Equipment.EGround Ground = new Atend.Base.Equipment.EGround();
                bool useAccess = false;
                if (Convert.ToBoolean(gvGround.Rows[gvGround.CurrentRow.Index].Cells[3].Value) == false)
                {
                    Ground    = Atend.Base.Equipment.EGround.AccessSelectByCode(Convert.ToInt32(gvGround.Rows[gvGround.CurrentRow.Index].Cells[0].Value.ToString()));
                    useAccess = true;
                }
                else if (Convert.ToBoolean(gvGround.Rows[gvGround.CurrentRow.Index].Cells[3].Value) == true)
                {
                    Ground    = Atend.Base.Equipment.EGround.SelectByXCode(new Guid(gvGround.Rows[gvGround.CurrentRow.Index].Cells[1].Value.ToString()));
                    useAccess = false;
                }

                Atend.Base.Acad.AcadGlobal.GroundData.eGround   = Ground;
                Atend.Base.Acad.AcadGlobal.GroundData.UseAccess = useAccess;

                Atend.Base.Base.BEquipStatus status = Atend.Base.Base.BEquipStatus.SelectByCode(Convert.ToInt32(cboIsExist1.SelectedValue));
                Atend.Base.Acad.AcadGlobal.GroundData.Existance = status.ACode;

                if (cboProjCode1.Items.Count == 0)
                {
                    Atend.Base.Acad.AcadGlobal.GroundData.ProjectCode = 0;
                }
                else
                {
                    Atend.Base.Acad.AcadGlobal.GroundData.ProjectCode = Convert.ToInt32(cboProjCode1.SelectedValue);
                }

                Atend.Control.Common.IsExist = Convert.ToInt32(cboIsExist1.SelectedValue.ToString());
                if (cboProjCode1.Items.Count != 0)
                {
                    Atend.Control.Common.ProjectCode = Convert.ToInt32(cboProjCode1.SelectedValue.ToString());
                }
                else
                {
                    Atend.Control.Common.ProjectCode = -1;
                }

                AllowClose = true;
            }
            else
            {
                AllowClose = false;
            }
        }
コード例 #5
0
ファイル: frmGround02.cs プロジェクト: ParisaMousavi/ATEND
 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 (selectedGround == Guid.Empty && IsDefault)
         {
             MessageBox.Show("کاربر گرامی شما اجازه ثبت تجهیز به صورت پیش فرض ندارید", "خطا");
             return(false);
         }
         else
         {
             Atend.Base.Equipment.EGround Equip = Atend.Base.Equipment.EGround.SelectByXCode(selectedGround);
             if (Equip.IsDefault || IsDefault)
             {
                 MessageBox.Show("کاربر گرامی شما اجازه ویرایش  تجهیز به صورت پیش فرض ندارید", "خطا");
                 return(false);
             }
         }
     }
     return(true);
 }