Exemplo n.º 1
0
    public void OnStage()
    {
        SqlClient.Main.CreateCommand("update DOG set KDGD = @kdgd where undog = @undog",
                                     new SqlParam("kdgd", "C"),
                                     new SqlParam("undog", Cursor.GetFieldValue <int>("UNDOG"))).ExecNonQuery();
        var dogRec = DogTable.GetRecord(Cursor.GetFieldValue <int>("UNDOG"));

        if (!DogStagin.CheckDocument(dogRec))
        {
            DogStagin.CreateDocument(dogRec);
        }
    }
Exemplo n.º 2
0
    public static int CreateDocument(DogTable.Record dogRecord)
    {
        var undog = dogRecord.Undog;
        //var dgt = Cursor.GetFieldValue<string>("KDGT");
        var dgt = (dogRecord.Undog_pr == 0) ? dogRecord.Kdgt : DogTable.GetRecord(dogRecord.Undog_pr, new String[] { "KDGT" }).Kdgt;
        //var dogstatus = Cursor.GetFieldValue<string>("KDGD");

        //var docType = SqlClient.Main.CreateCommand("select KDMT from DOGC_ where KDGT = @KDGT and KDGD = @KDGD",
        //    new SqlParam("KDGT", dgt),
        //    new SqlParam("KDGD", dogstatus)).ExecScalar<string>();

        //var docType = SqlClient.Main.CreateCommand(@"select PROTTYPE_ from dgt wher");
        var docType = DgtTable.GetRecord(dgt, new[] { "PROTTYPE_" }).GetFieldValue <string>("PROTTYPE_").Split(',').FirstOrDefault();

        //Формирование документа
        var document = new Document();

        document.FillDocConfig(docType);
        document.ContractorCode = dogRecord.Org;
        document.ContractCode   = undog;
        document.Status         = DocStatus.Project;
        //Добавление документа в SQL
        var docRepo = new HeadersRepository();

        docRepo.Add(document);

        //Установка документа на 1ю стадию
        var dmz = new DataEditor.StartInfo("DMZ10")
        {
            TemplateId = "DMZ",
            StartMode  = new DataEditor.StartInfo.DataEditorStartMode(
                new DataEditor.StartInfo.WorkflowStartMode(WorkflowProcessMode.SetRoute)
            {
                ExitAfterCall = true
            }),
            PrimaryKeyFilter = new Dictionary <string, object>()
            {
                { "UNDOC", document.Undoc }
            },
            Editable = true
        };
        var dc = new DocumentCondition(ConditionDbType.Dmz);

        dmz.Cursors["DMZ"].CustomProperties.Add(DocumentCaller.DocumentConditionPropertyName, dc);
        DataEditor.Call(dmz);

        return(document.Undoc);
    }
Exemplo n.º 3
0
 public bool Next()
 {
     return(DogStagin.CheckDocument(DogTable.GetRecord(Cursor.GetFieldValue <int>("UNDOG"))));
 }